Package de.dlr.proseo.api.prip.rest
Klasse OAuth2TokenController
java.lang.Object
de.dlr.proseo.api.prip.rest.OAuth2TokenController
@RestController
@Validated
@RequestMapping(value="/proseo/prip/v1/token",
produces="application/json")
public class OAuth2TokenController
extends Object
Spring MVC controller for requesting an access token for the prosEO PRIP API; implements the services required to provide a
RESTful API according to OAuth2 "Resource Owner Password Credentials Grant" flow and "Client Credentials Grant" flow as requested
in ESA's Production Interface Delivery Point (PRIP) API ICD (ESA-EOPG-EOPGC-IF-3, issue 1.5) and its associated "Technical Note
for the Interface Delivery Points Access and Authentication" (issue 1.0).
- Autor:
- Dr. Thomas Bassler
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungorg.springframework.http.ResponseEntity
<String> getToken
(String grantType, String username, String password, String scope, org.springframework.http.HttpHeaders httpHeaders) Create an authentication token and a refresh token for the user identified in the Basic Auth header
-
Konstruktordetails
-
OAuth2TokenController
public OAuth2TokenController()
-
-
Methodendetails
-
getToken
@RequestMapping(value="", method=POST) public org.springframework.http.ResponseEntity<String> getToken(@RequestParam(name="grant_type") String grantType, @RequestParam(required=false) String username, @RequestParam(required=false) String password, @RequestParam(required=false) String scope, @RequestHeader org.springframework.http.HttpHeaders httpHeaders) Create an authentication token and a refresh token for the user identified in the Basic Auth header- Parameter:
grantType
- Type of grant requested (value must be set to "password" for "Resource Owner Password Credentials Grant" flow or to "client_credentials" for "Client Credentials Grant" flow as per RFC 6749; REQUIRED)username
- The PRIP username (as per RFC 6749; REQUIRED for "Resource Owner Password Credentials Grant" flow, must not be set otherwise)password
- The PRIP password (as per RFC 6749; REQUIRED for "Resource Owner Password Credentials Grant" flow, must not be set otherwise)scope
- The scope of the access request (as per RFC 6749; OPTIONAL, will be ignored if set)httpHeaders
- the HTTP request headers- Gibt zurück:
- HTTP status OK and an OAuth2 token grant response, or HTTP status BAD_REQUEST and an OAuth2 error response, if any failure occurred (additionally the Warning header is set), or HTTP status INTERNAL_SERVER_ERROR and an OAuth2 error response, if any other unrecoverable failure occurred
-