Configuring an auth client or library
Auth libraries and clients that support the OAuth 2 flow can be configured to manage this authorisation for you. Here, you’ll find some notes on how to configure your preferred tooling to work with our authorisation service.Table of common options
These may not exactly match your preferred tooling but they’re listed as a guide to help you get set up.| Grant type | Authorisation code. |
|---|---|
| Authorisation URL | https://www.studentbeans.com/sso/[consumer supergroup] - you can see which values you can use for consumer supergroup in the API Reference. |
| Access Token URL | https://accounts.studentbeans.com/oauth/token |
| Refresh Token URL | https://accounts.studentbeans.com/oauth/token |
| Auth scheme | Authorization request header with Bearer prefix (recommended), request body or request URL. |
| Client ID | The client ID you were given when you registered with us. |
| Client secret | The client secret you were given when you registered with us. |
| Callback URL (or Redirect URI) | Two names for the same thing. This must be a redirect URI that you have registered with us. |
| Scope(s) | Not used. |
| State | Not used. |
Country
In addition to the above, you must ensure that your tooling is configured to include thecountry parameter in the authorisation URL. This should be set to uk if your client country is the UK, and an ISO 3166 two-letter country code otherwise.
Example:
Tracking in the Redirect URI
You can include additional query parameters on your redirect URI, which may be useful for passing information or tracking users on their round-trip to our authorisation service. These redirect URIs are identical to us:? with us. When we redirect users back to your app, we will include any query parameters that you added.
Please note:
- You must encode the entire redirect URI as a URI component
- You cannot use a parameter called
codebecause it will be overwritten with the authorisation grant code.
Support
We are not able to offer technical support for any OAuth 2 client or library and the above is just a guide - it may not exactly match what your preferred tooling offers. If you need to customise the flow beyond what your tooling supports, head to the next section to find out how to implement the authorisation step manually.Manual authorisation flow
Log a user in
Create a “Log In” link, sending the user to:www.studentbeans.com. These parameters are all required. Descriptions of query parameters and the possible values for the consumer supergroup can be found in the API reference.
When the user authorises your app
When your user has successfully logged in, verified (if necessary) and authorised your app, they will be redirected in their browser to your redirect URI, with thecode query parameter containing an authorisation grant code.
If you include any additional query parameters in the
redirect_uri in your login link, they will be added to this URI. If you include one called code, it will be overwritten.Get an access token
Once you have the authorisation grant code, you can make an HTTP POST request to our API to exchange it for an API access token. This access token is what gives you access to the user’s verification information.Request
accounts.studentbeans.com. These parameters are all required. Descriptions can be found in the API reference.
Response
- Success
- Error Example