Roadmap¶
Authentication¶
The below are simply notes, in relation to the potential for additional authentication options for SASjs Server.
Regardless of the mechanism used, credentials and user attributes are encrypted and stored internally as a JWT token. The token is associated with a SASjs Session ID, which is passed in each API request inside an
Authorisation:header attribute OR a cookie.
Viya Auth¶
This approach is recommended whenever Viya authorisation is available. The configuration steps are as follows:
- Configure SASjs Server for Viya Auth
- Register a client and secret (administrator task) using the authorization_code grant type. Here are some helpful resources.
- Enter the client / secret into the SASjs database (tool to be provided)
The user flow is as follows:
- Navigate to {SASjsServerUrl}/SASjsLogon
- Click "LOGON"
Behind the scenes, the following flow will occur:
/SASjsLogonpage will request the CLIENT_ID from/SASjsApi/auth/viyaclientid(unsecured endpoint)- The user is redirected to
/SASLogon/oauth/authorize?response_type=code&client_id=${CLIENT_ID} - Following authentication, the frontend will pass the AUTH_CODE to backend
- Backend will send CLIENT_ID, CLIENT_SECRET and AUTH_CODE to
/SASLogon/oauth/token, receiving the ACCESS_TOKEN and REFRESH_TOKEN in response - The ACCESS_TOKEN and REFRESH_TOKEN are stored (securely) in a JWT, and associated with a SASjs SESSION_ID
- The SESSION_ID is returned to
/SASjsLogonand stored in a cookie - Subsequent requests by the Frontend, or API clients, will make use of the SASjs Session ID (until expiry).
- If the ACCESS_TOKEN expires, the backend will refresh it automatically using the REFRESH_TOKEN.
The following diagram illustrates:
Auth0¶
Auth0 is a third party authentication provider, which supports all major authentication methods - such as SAML, SSO, LDAP, Social Logins, etc etc.