Aidbox
Search
K

Implicit Grant

Implicit Grant flow. Supported but not recommendted to use
Implicit flow is not recommended to use since there is a risk of leaking access token without any confirmation it was received by the client. More over, some servers prohibit this flow entirely. Aidbox supports Implicit Grant flow but we don't enjoy it very much.
It is better to switch to Authorization Code Grant with PKCE extension instead

Description

Implicit Grant flow is an alternative for Authorization Code flow. This flow just receives access_token in query string fragment instead of obtaining securecode. It's indented for client-side apps use in order to access an API, typically as Web SPA applications. For more detailed information, read OAuth 2.0 specification.
Basic scheme
get
[base]/
auth/authorize
Authorization Endpoint
After this request, the resource owner (user) will be redirected to Log-in/Sign-up page.
Example
Next step is granting access to the client:
Example
After granting access the user is redirected to the redirect_uri from the client configuration with access_token in query string fragment.

Example

Create client
POST /Client
Accept: text/yaml
Content-Type: text/yaml
id: imp-client
resourceType: Client
grant_types:
- implicit
auth:
implicit:
redirect_uri: http://localhost:3449/auth.html
Request access token
Response
curl -X GET \
'http://localhost:8081/auth/authorize?
state=example
&client_id=imp-client
&redirect_uri=http%3A%2F%2Flocalhost%3A3449%2Fauth.html
&response_type=token'
HTTP/1.1 302 Found
Location: http://localhost:3449/auth.html#access_token=ZGE0ZmQzZTYtOGU0OC00MDJhLWFkN2ItZTg5ZmViYjdmNTQ2
&state=example