Authentication And Authorization (AAA) SDK for Web
The AAA SDK for Web is built on top of react, oidc-react, and typescript. This SDK can be used for authentication, maintaining access tokens, fetching user info, and appending headers to the REST API calls.
Use the initCAS API of the SDK to create auth instance and fetch the AuthProvider component.
JS
import{ initCAS }from'@os1-platform/aaa-web';const AuthProvider =initCAS('CLIENTID',// This is the clientId that you get after creating an app.'/fms/success',// success pathname (https://abc.fxtrt.io/fms/success)'web',// device type'/fms/failure',//logoutRedirectPath'TenantIdForDevelopmentMode'//static tenantId for development mode to test any functionality locally (accepted if the sub-domain is developer or developer2)(optional field));

Wrap your application in this single AuthProvider component. For example:
Use the isAuthenticated method to put a check on private pages:This checks if the user has valid permissions to access private pages that require access via token, unlike public pages like the 'Contact Us' page.
Use the HttpClient API to create a client for network requests.
JS
import{ HttpClient as client }from'@os1-platform/aaa-web';classNetworkClient{public readonly instance: any;constructor(){this.instance = client.createClient({baseURL:`https://abc.preprod.fxtrt.io/core/api/v1/aaa`,});}}

The following headers are automatically configured to requests originating from the NetworkClient adding Access token(x-coreos-access) or the Tenant ID(x-coreos-tid) or User info(x-coreos-userinfo) or Auth token(x-coreos-auth) headers to the actual request.
withAccess
withTid
withUserInfo
withAuth
Note:
By default all these headers are true, i.e., will be passed to the REST API. The user needs to specifically pass value against these headers as false if they don't wish to pass certain headers.
Access token is verified and regenerated (if expired), every time an API request is made.
Authentication And Authorization (AAA) SDK for Mobile
The AAA (Authentication And Authorization) SDK for mobile is used for authentication purposes to integrate with the front-end applications. This SDK is built on top of react-native, react-native-app-auth, and typescript. You can use this SDK on mobile for authentication, fetching access tokens, and logout features.
import{ LoginHelper }from'@os1-platform/aaa-mobile';const accessToken =await LoginHelper.fetchAccessToken();//This will fetch the latest access token from the storage and if the token is expired then it calls refresh token internally and returns the new access token.