Software Update: Wednesday 9th October 2024 7am to 7:30am

On Wednesday, we're updating OneFile Eportfolio, to introduce a new enhancement.  

Please ensure all data is saved and your Eportfolio account is logged out before 7am to avoid any data loss.

Release notes can be found here.


Help centre

Submit a ticket Log in

Single Sign-On: using OneFile as an Authentication provider

This article explains how to use OneFile as an authentication provider. We provide an oAuth 2.0 integration.

Authorisation Request

GET

https://login.onefile.co.uk/auth?client_id={YOUR_CLIENT_ID}&redirect_uri={YOUR_REDIRECT_URI}&state={YOUR_STATE_TOKEN}&scope=user&response_type=code
ParameterTypeUse
client_idAlpha numeric stringUsed to identify the connecting external service provider
redirect_uriStringUsed as the redirect url when user authentication is complete, this must match the redirect url that was inputted when setting up the client
stateStringUsed to validate the authorization response, preventing CSRF attacks

This call will allow the user to authenticate, then return them to the redirect uri with an authorization code, which can then be used to request an access token this will look like this:

GET

{YOUR_REDIRECT_URI}?code={THE_GENERATED_AUTH_CODE}&state={YOUR_STATE_TOKEN}

From this you will then need to make an access token request, as shown below.


Access Token Request

POST

https://login.onefile.co.uk/token?client_id={YOUR_CLIENT_ID}&client_secret={YOUR_CLIENT_SECRET}&grant_type=authorization_code&redirect_uri={YOUR_REDIRECT_URI}&code={YOUR_AUTHORIZATION_CODE}
ParameterTypeUse
client_idAlpha numeric stringUsed to identify the connecting external service provider
redirect_uriStringUsed as the redirect url when user authentication is complete, this must match the redirect url that was inputted when setting up the client
codeStringUsed to validate the access token request for a user
client_secretStringUsed to validate that the request for the access token is coming from the external service provider that created the oAuth client

This will respond with an access token that can be used to request information for the user.

ContentType: application/json
{
    “access_token”: “{THE_ACCESS_TOKEN}”,
    “token_type”: “bearer”
} 


User Details Request

GET

https://login.onefile.co.uk/me

Headers:

Authorisation: {THE_TOKEN_TYPE} {THE_ACCESS_TOKEN}

N.B the space is important

Response:

ContentType : application/json
{
    “UserID”: “”
    “FirstName”: “John”,
    “LastName”: “Smith”
 }


Visual Representation

Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.