DS Server

GET /authenticationserver/authorize

Endpoint

GET https://example.com/authenticationserver/authorize

Description

Requests an authorization code or an access token like GET /oauth/authorize, with the same parameters and responses, but without forwarding an unsuccessful request to the registered authentication servers. The endpoint was added in DS Server 3.1.0.

When GET /oauth/authorize can't authorize a request, for example because it doesn't know the client ID, DS Server sends the query parameters to /authenticationserver/authorize of the registered authentication servers.

Examples

The following sample requests an authorization code using the "code" flow. The authorization code is returned to the given redirect URI.

# Request:
curl --request GET 'https://trial.dsserver.io/authenticationserver/authorize?redirect_uri=https://localhost:5001/callback&client_id=yourclientid&response_type=code&state=teststate'

# Response:
HTTP/1.1 302 Found
Location: https://localhost:5001/callback?code=g0ZGZmNjVmOWIjNTk2NTk4ZTYyZGI3&state=teststate

Request Parameters

NameTypeValueOptional
client_idStringThe client ID of the security profile.no
response_typeStringThe type of the requested response. Supported values are "code" and "token".no
redirect_uriStringThe redirect URI must match one of the authorized redirect URIs of the security profile. Upper and lower case are ignored; the scheme, host, port, path and query string must be the same.no
stateStringDS Server echoes back the state value in the redirect.yes
scopeStringThe scope of the request.yes

Success Response

StatusDescription
302On success, the request is redirected to the given redirect URI with the query parameters code and state ("code") or access_token, token_type, expires_in and state ("token").

Error Response

StatusDescription
400A 400 (Bad Request) with the plain text (text/plain) "Missing, invalid or mismatching redirection URI." is returned, if the redirect URI is missing or is not one of the authorized redirect URIs of the security profile.
302Other errors are returned to the redirect URI in the query parameters error, error_description and state: unauthorized_client with an empty description for an unknown client ID, and unsupported_response_type "Unsupported response type." for a response type other than "code" or "token".
302Without a client ID or a response type, the Location header holds only the query string ?error=invalid_request&error_description=... with "Missing 'client_id' parameter." or "Missing 'response_type' parameter.", without the redirect URI and without state.