Project

General

Profile

1

    
2

    
3
<!DOCTYPE html>
4
<html lang="en-gb">
5
	<head>
6
		<meta charset="utf-8">
7
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
8
		<meta name="viewport" content="width=device-width, initial-scale=1">
9
		<meta http-equiv="content-type" content="text/html; charset=utf-8" />
10
		<meta name="description" content="OpenAIRE API documentation - Authentication, registered services, basic service authentication and registration, how to register"/>
11
		<link href="assets/common-assets/logo-small-graph.png">
12
		<link rel="apple-touch-icon" sizes="57x57" href="assets/common-assets/logo/apple-icon-57x57.png">
13
		<link rel="apple-touch-icon" sizes="60x60" href="assets/common-assets/logo/apple-icon-60x60.png">
14
		<link rel="apple-touch-icon" sizes="72x72" href="assets/common-assets/logo/apple-icon-72x72.png">
15
		<link rel="apple-touch-icon" sizes="76x76" href="assets/common-assets/logo/apple-icon-76x76.png">
16
		<link rel="apple-touch-icon" sizes="114x114" href="assets/common-assets/logo/apple-icon-114x114.png">
17
		<link rel="apple-touch-icon" sizes="120x120" href="assets/common-assets/logo/apple-icon-120x120.png">
18
		<link rel="apple-touch-icon" sizes="144x144" href="assets/common-assets/logo/apple-icon-144x144.png">
19
		<link rel="apple-touch-icon" sizes="152x152" href="assets/common-assets/logo/apple-icon-152x152.png">
20
		<link rel="apple-touch-icon" sizes="180x180" href="assets/common-assets/logo/apple-icon-180x180.png">
21
		<link rel="icon" type="image/png" sizes="192x192" href="assets/common-assets/logo/android-icon-192x192.png">
22
		<link rel="icon" type="image/png" sizes="32x32" href="assets/common-assets/logo/favicon-32x32.png">
23
		<link rel="icon" type="image/png" sizes="96x96" href="assets/common-assets/logo/favicon-96x96.png">
24
		<link rel="icon" type="image/png" sizes="16x16" href="assets/common-assets/logo/favicon-16x16.png">
25
		<link href="assets/common-assets/logo/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon"/>
26
		<title>OpenAIRE API documentation - Authentication Registered Services (Basic)</title>
27
		<script  src="./assets/common-assets/jquery/jquery.js"></script>
28
		<script  src="./assets/uikit.js"></script>
29
		<script src="./assets/uikit-icon-max.js"></script>
30
		<!-- Include header and footer files -->
31
		<script>
32
			$(function(){
33
				$("#headerMobile").load("headerMobile.html");
34
				$("#header").load("header.html");
35
			});
36
		</script>
37
		<!-- Matomo -->
38
		<script type="text/javascript">
39
			var _paq = window._paq || [];
40
			/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
41
			_paq.push(['trackPageView']);
42
			_paq.push(['enableLinkTracking']);
43
			(function() {
44
			var u="//analytics.openaire.eu/";
45
			_paq.push(['setTrackerUrl', u+'matomo.php']);
46
			_paq.push(['setSiteId', '470']);
47
			var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
48
			g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
49
			})();
50
		</script>
51
		<link rel="stylesheet" type="text/css" href="./assets/common-assets/common/theme.css">
52
		<link rel="stylesheet" type="text/css" href="./assets/common-assets/common/custom.css">
53
		<link rel="stylesheet" type="text/css" href="./assets/common-assets/library.css">
54
		<link rel="stylesheet" type="text/css" href="./assets/develop-custom.css">
55
	</head>
56
	<body class="graphApp">
57
		<div class="uk-offcanvas-content uk-height-viewport">
58

    
59
			<!-- Header menu STARTS here-->
60
			<div id="headerMobile" class="tm-header-mobile uk-hidden@m"></div>
61
			<div id="header" class="tm-header uk-visible@m tm-header-transparent" uk-header=""></div>
62
			<!-- Header menu ENDS here-->
63

    
64
			<div class=" first_page_section uk-section-default uk-section uk-padding-remove-vertical">
65
					<div class="first_page_banner_headline uk-grid-collapse uk-flex-middle uk-margin-remove-vertical uk-grid" uk-grid="">
66
					</div>
67
			</div>
68

    
69
			<!-- Page content STARTS here -->
70
				<div class="uk-section tm-middle custom-main-content" id="tm-main">
71
					<div class="uk-margin-large-left uk-margin-medium-bottom">
72
						<ul class="uk-breadcrumb">
73
							<li>
74
								<a href="/">Home</a>
75
							</li>
76
							<li>
77
								<a href="overview.html">Resources</a>
78
							</li>
79
							<li>
80
								<a style="cursor: default;">APIs</a>
81
							</li>
82
							<li>
83
								<a href="authentication.html">Authentication</a>
84
							</li>							
85
							<li>
86
								<a href="registeredService.html">Registered Services</a>
87
							</li>
88
							<li>
89
								<span>Basic</span>
90
							</li>
91
						</ul>
92
					</div>
93
						<div class="uk-container">
94
							<div class="uk-grid">
95
								<div class="uk-width-1-3@s uk-width-1-4@m uk-width-1-4@l uk-visible@m" >
96
										<ul class="uk-nav-default uk-nav-parent-icon" uk-nav="multiple: false" uk-sticky="offset: 115; media:@s" >
97
													<li class="uk-parent uk-open">
98
															<a href="#">Authentication</a>
99
															<ul class="uk-nav-sub">
100
																	<li><a href="./authentication.html">General Information</a></li>
101
																	<li><a href="./personalToken.html">Personal Token</a></li>
102
																	<li><a href="./registeredService.html">Registered Services</a>
103
																		<ul class="uk-nav-sub">
104
																			<li class="uk-active"><b><a href="./basic.html">Basic</a></b></li>
105
																			<li><a href="./advanced.html">Advanced</a></li>
106
																	</ul>
107
																</li>
108
															</ul>
109
													</li>
110
											</ul>
111
								</div>
112

    
113

    
114
								<div   class="tm-main uk-width-expand uk-row-first uk-first-column">
115

    
116
									<h2 class="uk-text-center" id="service">Basic service authentication and registration</h2>               
117
								
118
									<p>For the <b>Basic Authentication</b> method the OpenAIRE AAI server generates a pair of <em>Client ID</em> and <em>Client Secret</em> 
119
										for your service upon its registration. The service uses the client id and client secret to obtain the access 
120
										token for the OpenAIRE APIs. The OpenAIRE AAI server checks whether the client id and client secret sent is valid.
121
									</p> 
122
									
123
									<h4>How to register your service</h4>
124
									<p>To register your service you need to:</p>
125
									<ol>
126
										<li>Login to OpenAIRE. In case you are not already a member you will need to register first.</li>
127
										<li>Go to your <a href="https://services.openaire.eu/uoa-user-management/registeredServices" target="_blank"> Registered Services</a> page and click the New Service button.</li>
128
										<li>Provide the <span class="uk-text-primary"><b>"Νame"</b></span> (mandatory) of your service.</li>
129
										<li>Select the Basic <span class="uk-text-primary"><b>"Security level"</b></span>.</li>
130
										<li>Click the <span class="uk-text-primary"><b>Add New Service</b></span> button.</li>
131
									</ol>
132
									<p>Once your service is created, the <em>Client ID</em> and <em>Client Secret</em> will appear on your screen. Click 
133
										<span class="uk-text-primary">"OK"</span> and your new service will be appear in the list of your <a href="https://services.openaire.eu/uoa-user-management/registeredServices" target="_blank">Registered Services</a> page.</p>
134

    
135
									<h4>How to make a request</h4>
136
									<h5><span class="uk-text-bold">Step 1.</span> Request for an access token</h5>
137
									<p>
138
										To make an access token request use the <em>Client ID</em> and <em>Client Secret</em> of your service.
139

    
140
										<pre class="uk-text-left">
141
	curl -u {CLIENT_ID}:{CLIENT_SECRET} \
142
	-X POST 'https://aai.openaire.eu/oidc/token' \
143
	-d 'grant_type=client_credentials'</pre>
144
										<p>where <b>{CLIENT_ID}</b> and <b>{CLIENT_SECRET}</b> are the <em>Client ID</em> and <em>Client Secret</em> assigned to your service 
145
												upon registration.
146
										<p>
147
												The response is:
148
												<pre class="uk-text-left">
149
{
150
	"access_token": ...,
151
	"token_type": "Bearer",
152
	"expires_in": ...
153
}</pre>
154
										</p>
155
									</p>
156
									<div class="uk-alert-danger" uk-alert>
157
												<p>Store the access token confidentially on the service side.</p>
158
										</div>
159
									
160
									<h5><span class="uk-text-bold">Step 2.</span> Make a request</h5>
161
									<p>To access the OpenAIRE APIs send the access token returned in <span class="uk-text-primary"><b>Step 1</b></span>.</p>
162

    
163
									<pre class="uk-text-left">
164
	GET https://api.openaire.eu/{resourceServicePath}
165
	Authorization: Bearer {ACCESS_TOKEN}</pre>
166
									
167

    
168
									<h4>Error messages</h4>
169
									
170
									<p>401 - Missing username or/and password</p>
171
									<pre class="uk-text-left">
172
{
173
	"error": "unauthorized",
174
	"error_description": "Client id must not be empty!"
175
}</pre>
176
									
177
									<p>401 - Wrong username or/and password</p>
178
									<pre class="uk-text-left">
179
{
180
	"error": "unauthorized",
181
	"error_description": "Bad credentials"
182
}</pre>
183
									
184
									<p>400 - Missing grant type</p>
185
									<pre class="uk-text-left">
186
{
187
	"error": "invalid_request",
188
	"error_description": "Missing grant type"
189
}</pre>
190

    
191
									<p>400 - Wrong grant type</p>
192
									<pre class="uk-text-left">
193
{
194
	"error": "unsupported_grant_type",
195
	"error_description": "Unsupported grant type: ..."
196
}</pre>
197
						</div> <DO NOT REMOVE>
198
					</div>
199
				</div>
200
			</div>
201
			<!-- Page content ENDS here -->
202

    
203
			<!-- Footer STARTS here -->
204
			<bottom class="footer">
205
				<div class="footer-light-background uk-padding-remove-bottom uk-section uk-section-small">
206
					<div class="uk-container uk-container-small">
207
						<div>
208
							<div id="footer#3" class="uk-first-column uk-flex uk-flex-middle uk-grid uk-margin-remove-right">
209
								<div class="uk-text-center uk-width-1-1 uk-width-1-4@m">
210
									<img width="126px" height="30px" alt="OpenAIRE" loading="lazy" class="el-image" src="assets/common-assets/common/Logo_Horizontal_dark_small.png">
211
								</div>
212
								<div id="footer#5" class="uk-margin uk-text-left uk-width-expand">
213
									<div class="uk-flex uk-flex-middle">
214
										<div>
215
											<img alt="flag black white low" width="50px" height="33px" loading="lazy" style="margin-right: 8px; float: left;" src="assets/common-assets/common/commission.jpg">
216
										</div>
217
										<div class="uk-margin-left">
218
											<div>
219
													<span style="font-size: 8pt; line-height: 0.7!important;">OpenAIRE has received funding from the European Union's Horizon 2020 research and innovation programme under grant agreements No. 777541 and 101017452</span>
220
											</div>
221
										</div>
222
									</div>
223
								</div>
224
							</div>
225
							<div>
226
								<div class="uk-width-expand@m">
227
									<div id="footer#7" class="uk-text-right@m uk-text-center">
228
										<ul uk-margin="" class="uk-flex-center uk-margin-remove-bottom uk-subnav uk-subnav-divider"></ul>
229
									</div>
230
								</div>
231
							</div>
232
							<div class="uk-margin uk-text-center uk-width-1-1">
233
								<div uk-grid="" class="uk-child-width-auto uk-flex-center uk-grid uk-grid-small">
234
									<div class="uk-first-column">
235
										<a href="https://www.facebook.com/groups/openaire/" target="_blank" class="el-link uk-icon-button uk-icon">
236
											<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
237
												<path d="M11,10h2.6l0.4-3H11V5.3c0-0.9,0.2-1.5,1.5-1.5H14V1.1c-0.3,0-1-0.1-2.1-0.1C9.6,1,8,2.4,8,5v2H5.5v3H8v8h3V10z"></path>
238
											</svg>
239
										</a>
240
									</div>
241
									<div>
242
										<a href="https://www.twitter.com/OpenAIRE_eu" target="_blank" class="el-link uk-icon-button uk-icon">
243
											<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
244
												<path d="M19,4.74 C18.339,5.029 17.626,5.229 16.881,5.32 C17.644,4.86 18.227,4.139 18.503,3.28 C17.79,3.7 17.001,4.009 16.159,4.17 C15.485,3.45 14.526,3 13.464,3 C11.423,3 9.771,4.66 9.771,6.7 C9.771,6.99 9.804,7.269 9.868,7.539 C6.795,7.38 4.076,5.919 2.254,3.679 C1.936,4.219 1.754,4.86 1.754,5.539 C1.754,6.82 2.405,7.95 3.397,8.61 C2.79,8.589 2.22,8.429 1.723,8.149 L1.723,8.189 C1.723,9.978 2.997,11.478 4.686,11.82 C4.376,11.899 4.049,11.939 3.713,11.939 C3.475,11.939 3.245,11.919 3.018,11.88 C3.49,13.349 4.852,14.419 6.469,14.449 C5.205,15.429 3.612,16.019 1.882,16.019 C1.583,16.019 1.29,16.009 1,15.969 C2.635,17.019 4.576,17.629 6.662,17.629 C13.454,17.629 17.17,12 17.17,7.129 C17.17,6.969 17.166,6.809 17.157,6.649 C17.879,6.129 18.504,5.478 19,4.74"></path>
245
											</svg>
246
										</a>
247
									</div>
248
									<div>
249
										<a href="https://www.linkedin.com/groups/3893548/" target="_blank" class="el-link uk-icon-button uk-icon">
250
											<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
251
												<path d="M5.77,17.89 L5.77,7.17 L2.21,7.17 L2.21,17.89 L5.77,17.89 L5.77,17.89 Z M3.99,5.71 C5.23,5.71 6.01,4.89 6.01,3.86 C5.99,2.8 5.24,2 4.02,2 C2.8,2 2,2.8 2,3.85 C2,4.88 2.77,5.7 3.97,5.7 L3.99,5.7 L3.99,5.71 L3.99,5.71 Z"></path>
252
												<path d="M7.75,17.89 L11.31,17.89 L11.31,11.9 C11.31,11.58 11.33,11.26 11.43,11.03 C11.69,10.39 12.27,9.73 13.26,9.73 C14.55,9.73 15.06,10.71 15.06,12.15 L15.06,17.89 L18.62,17.89 L18.62,11.74 C18.62,8.45 16.86,6.92 14.52,6.92 C12.6,6.92 11.75,7.99 11.28,8.73 L11.3,8.73 L11.3,7.17 L7.75,7.17 C7.79,8.17 7.75,17.89 7.75,17.89 L7.75,17.89 L7.75,17.89 Z"></path>
253
											</svg>
254
										</a>
255
									</div>
256
									<div>
257
										<a href="https://www.slideshare.net/OpenAIRE_eu" target="_blank" class="el-link uk-icon-button uk-icon">
258
											<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
259
												<line fill="none" stroke="#000" stroke-width="1.1" x1="13.4" y1="14" x2="6.3" y2="10.7"></line>
260
												<line fill="none" stroke="#000" stroke-width="1.1" x1="13.5" y1="5.5" x2="6.5" y2="8.8"></line>
261
												<circle fill="none" stroke="#000" stroke-width="1.1" cx="15.5" cy="4.6" r="2.3"></circle>
262
												<circle fill="none" stroke="#000" stroke-width="1.1" cx="15.5" cy="14.8" r="2.3"></circle>
263
												<circle fill="none" stroke="#000" stroke-width="1.1" cx="4.5" cy="9.8" r="2.3"></circle>
264
											</svg>
265
										</a>
266
									</div>
267
									<div>
268
										<a href="https://www.youtube.com/channel/UChFYqizc-S6asNjQSoWuwjw" target="_blank" class="el-link uk-icon-button uk-icon">
269
											<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
270
												<path d="M15,4.1c1,0.1,2.3,0,3,0.8c0.8,0.8,0.9,2.1,0.9,3.1C19,9.2,19,10.9,19,12c-0.1,1.1,0,2.4-0.5,3.4c-0.5,1.1-1.4,1.5-2.5,1.6 c-1.2,0.1-8.6,0.1-11,0c-1.1-0.1-2.4-0.1-3.2-1c-0.7-0.8-0.7-2-0.8-3C1,11.8,1,10.1,1,8.9c0-1.1,0-2.4,0.5-3.4C2,4.5,3,4.3,4.1,4.2 C5.3,4.1,12.6,4,15,4.1z M8,7.5v6l5.5-3L8,7.5z"></path>
271
											</svg>
272
										</a>
273
									</div>
274
									<div>
275
										<a target="_blank" href="https://www.openaire.eu/newsletter" class="el-link newsletter">
276
											<span class="el-title uk-margin uk-text-large"> Newsletter 
277
												<span class="el-image uk-icon">
278
													<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
279
														<circle cx="3.12" cy="16.8" r="1.85"></circle>
280
														<path fill="none" stroke="#000" stroke-width="1.1" d="M1.5,8.2 C1.78,8.18 2.06,8.16 2.35,8.16 C7.57,8.16 11.81,12.37 11.81,17.57 C11.81,17.89 11.79,18.19 11.76,18.5"></path><path fill="none" stroke="#000" stroke-width="1.1" d="M1.5,2.52 C1.78,2.51 2.06,2.5 2.35,2.5 C10.72,2.5 17.5,9.24 17.5,17.57 C17.5,17.89 17.49,18.19 17.47,18.5"></path>
281
													</svg>
282
												</span>
283
											</span>
284
										</a>
285
									</div>
286
								</div>
287
							</div>
288
						</div>
289
					</div>
290
				</div>
291
				<div class="footer-light-background uk-section uk-section-xsmall">
292
					<div class="uk-container uk-container-expand">
293
						<div uk-grid="" class="uk-grid-margin uk-grid">
294
							<div class="uk-width-small@m uk-first-column"></div>
295
							<div class="uk-width-expand@m">
296
								<div id="footer#22" class="uk-text-small uk-margin uk-margin-remove-bottom uk-text-center@m uk-text-center">
297
									<a href="http://creativecommons.org/licenses/by/4.0/" rel="license" class="license"> &nbsp;
298
										<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
299
											<path id="creative-commons" d="M9.7,14.675a1.311,1.311,0,0,1-1.15-.557,2.511,2.511,0,0,1-.391-1.477q0-2.032,1.541-2.034a1.36,1.36,0,0,1,.666.205,1.569,1.569,0,0,1,.605.718l1.541-.8A3.222,3.222,0,0,0,9.457,9.067a3.249,3.249,0,0,0-2.412.964,3.548,3.548,0,0,0-.957,2.61,3.562,3.562,0,0,0,.945,2.63,3.362,3.362,0,0,0,2.485.942,3.367,3.367,0,0,0,1.766-.481,3.408,3.408,0,0,0,1.254-1.326l-1.419-.718a1.44,1.44,0,0,1-1.416.987Zm6.634,0a1.312,1.312,0,0,1-1.15-.557,2.511,2.511,0,0,1-.391-1.477q0-2.032,1.541-2.034a1.389,1.389,0,0,1,.686.205,1.577,1.577,0,0,1,.608.718l1.519-.8a3.181,3.181,0,0,0-3.04-1.663,3.253,3.253,0,0,0-2.412.964,3.546,3.546,0,0,0-.955,2.61,3.576,3.576,0,0,0,.934,2.63,3.349,3.349,0,0,0,2.5.942,3.328,3.328,0,0,0,1.745-.481,3.54,3.54,0,0,0,1.274-1.326l-1.438-.718a1.441,1.441,0,0,1-1.416.987ZM21.156,4.12A11.61,11.61,0,0,0,12.624.64a11.436,11.436,0,0,0-8.44,3.48A11.738,11.738,0,0,0,.641,12.64,11.537,11.537,0,0,0,4.185,21.1a11.532,11.532,0,0,0,8.44,3.541,11.856,11.856,0,0,0,8.592-3.57,11.389,11.389,0,0,0,3.424-8.431,11.583,11.583,0,0,0-3.484-8.52Zm-1.5,15.391a9.631,9.631,0,0,1-7,2.94,9.479,9.479,0,0,1-6.938-2.911A9.422,9.422,0,0,1,2.8,12.64,9.57,9.57,0,0,1,5.747,5.68,9.3,9.3,0,0,1,12.655,2.8a9.4,9.4,0,0,1,6.94,2.88,9.411,9.411,0,0,1,2.884,6.96,9.157,9.157,0,0,1-2.823,6.87Z" transform="translate(-0.641 -0.64)"></path>
300
										</svg>
301
										<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
302
											<g id="Group_756" data-name="Group 756" transform="translate(0)">
303
													<path id="Path_2324" data-name="Path 2324" d="M18.325,11.98a.775.775,0,0,0-.775-.775H12.641a.775.775,0,0,0-.775.775v4.909h1.369V22.7h3.719V16.889h1.37V11.98Z" transform="translate(-3.095 -2.951)"></path>
304
													<path id="Path_2325" data-name="Path 2325" d="M17.209,7.759A1.679,1.679,0,1,1,15.53,6.08,1.679,1.679,0,0,1,17.209,7.759Z" transform="translate(-3.529 -1.83)"></path>
305
													<path id="Path_2326" data-name="Path 2326" d="M12.624.64A11.439,11.439,0,0,0,4.183,4.12,11.736,11.736,0,0,0,.639,12.64,11.537,11.537,0,0,0,4.183,21.1a11.531,11.531,0,0,0,8.441,3.54,11.851,11.851,0,0,0,8.591-3.57,11.383,11.383,0,0,0,3.424-8.43,11.582,11.582,0,0,0-3.484-8.52,11.612,11.612,0,0,0-8.53-3.48Zm.03,2.159a9.4,9.4,0,0,1,6.939,2.88,9.414,9.414,0,0,1,2.883,6.96,9.156,9.156,0,0,1-2.823,6.87,9.63,9.63,0,0,1-7,2.94,9.48,9.48,0,0,1-6.939-2.91A9.425,9.425,0,0,1,2.8,12.64,9.573,9.573,0,0,1,5.746,5.68,9.3,9.3,0,0,1,12.654,2.8Z" transform="translate(-0.639 -0.64)"></path>
306
											</g>
307
										</svg>
308
									</a> &nbsp;Unless otherwise indicated, all materials created by OpenAIRE are licenced under
309
									<a href="http://creativecommons.org/licenses/by/4.0/" rel="license">
310
											CC ATTRIBUTION 4.0 INTERNATIONAL LICENSE
311
									</a>. 
312
								</div>
313
							</div>
314
							<div class="uk-width-small@m">
315
								<div class="uk-margin uk-margin-remove-top uk-margin-remove-bottom uk-text-right@m uk-text-center">
316
									<a href="#" uk-scroll="" class="uk-totop uk-icon">
317
										<svg width="18" height="10" viewBox="0 0 18 10" xmlns="http://www.w3.org/2000/svg" data-svg="totop">
318
											<polyline fill="none" stroke="#000" stroke-width="1.2" points="1 9 9 1 17 9 "></polyline>
319
										</svg>
320
									</a>
321
								</div>
322
							</div>
323
						</div>
324
					</div>
325
				</div>
326
			</bottom>
327
			<!-- Footer ENDS here -->
328
			
329
		</div>
330
	</body>
331
</html>
(8-8/19)