The first three articles talked about client credentials, password and authorization code authorization modes. This article will talk about implicit mode.
This mode directly applies the token to the authentication server in the browser without going through the client server, skipping the step of “authorization code”. All steps are completed in the browser and the token is directly passed in the callback url.
It is suitable for applications that directly obtain token in front-end applications.
The steps are similar to the authorization code except that the authorization code is missing:
- Request token from authentication server in browser
- User login (if not previously)
- User authorization
- After authorization, jump directly to redirectUri and carry token in url.
- Note that here response_type=token
- There is no need to pass client secret; the client_id is passed only to verify whether the redirect_uri configured in auth server is consistent.
- If the redirect_uri carries parameters, it is better to encode the url and pass it as parameters
You can find that the url directly carries information such as access_token
Of course, with implicit mode, there is no need to use the client module of spring security oauth2, because you go directly to browser mode.