The OAuth 2.0 Grant Type “implicit”
The current OAuth 2.0 specification provides a special grant type for simplified authorization. With the grant type “implicit,” a JavaScript app, for example, can obtain a required access token directly, without the otherwise usual step through an authorization server. As with the OAuth2 grant “authorization_code,” an implicit grant begins on the client side, for example with the data storage service Dropbox.
A new user either has to register there from scratch or, alternatively, log in with an existing Google account. If this simplified procedure through Google is used, Dropbox opens a browser window of the Google authorization server through a link and asks there for various functions to be released. If the user confirms the request and releases the functions, they are immediately led back to Dropbox through the attached URI. The URL then contains an access token that enables the user at Dropbox.
Authorization Step by Step
Compared with the relatively strong and secure grant type “authorization_code,” this type quite deliberately puts simplified handling first. The price for this, however, is the absence of an additional security procedure, which leaves the application highly vulnerable to attack. A direct comparison of the two grant types shows clear differences. The following parties are involved in an authorization process.
- A user who wants to use an app or a web service from a service provider such as Dropbox.
- A service provider such as Dropbox as the client, which offers an app, a web service, or further services for users.
- A provider such as Google, with which a user is already registered with their complete data.
At this point, the two grant types are still very similar. On the client side, however, the services usually come with different requirements. When a user signs in, the corresponding permissions therefore have to be obtained beforehand. For the user, signing in results in the following scenario.
- The user navigates to the provider’s website. To ultimately be able to use the services of Dropbox, for example, they either have to register there from scratch or can log in directly with an existing account, for example with Google.
- At Dropbox, the user now finds a “Sign up with Google” button. If they click this button, they are redirected to Google’s pages and get a login dialog for their existing customer account there. After entering the login credentials, the user finds detailed information in a dialog window about which data and permissions Dropbox would like to use.
- If the user now confirms these permissions, they are immediately redirected back to Dropbox and are already logged in there. Nothing now stands in the way of using the services.
Simplified Protocol and Process Steps for the Client
Up to this point, the authorization procedure still consists of similar steps from the user’s perspective. The great advantage of this authorization is the simplified sign-in procedure with a large number of clients that offer authorization based on the OAuth 2.0 protocol. With an existing customer account at Google, for example, a user can quickly sign in to many services with all their customer data and thus only has to remember one password. For Dropbox as the client, the following process steps result for registering a user.
- If a user wants to sign in through the “Sign up with Google” button, they first have to be redirected to Google through a login or redirect dialog. Additional details such as client_id, redirect_uri, and state are supplied right away through various parameters. There the user is shown the required permissions and asked to approve them.
- Once the user has signed in to Google and grants the Dropbox permissions, they are immediately redirected back to Dropbox through the URI supplied. In the process, Google also directly supplies an access token and a state in the URL.
At this point, we now have completely different behavior compared with the grant type “authorization_code,” and it is no longer visible to the user. The client, Dropbox in our example, can use the returned token immediately and thereby bypasses the secured request to the authorization server. Important security parameters such as client_secret and code are thus lost or are not requested. As a result, the “bare” URL parameters are exposed to manipulation. In addition, no back channel is available any longer to secure the token and the secret.
Convenience or Security?
At this point, the questions of convenience and security in an authorization process practically impose themselves. The OAuth2 grant “implicit” was originally developed to simplify the authorization of JavaScript apps. In practical use, however, the great danger of misuse quickly becomes apparent. This cancels out the actual benefit.
With regard to data protection, there are very serious concerns here. In addition, the token is transmitted openly and can therefore be manipulated. A further aspect is that with the grant type “implicit” the token is even stored in the browser history and remains retrievable beyond its validity period. For these reasons, the use of this OAuth2 grant type is generally no longer recommended, because it no longer meets the high security requirements of the complete authorization process.