This repository has been archived by the owner on Oct 24, 2024. It is now read-only.
jmelberg-okta
released this
27 Mar 23:22
·
271 commits
to master
since this release
Features
c7248b3
- Adds ability to override theresponse_type
(#109)c36b794
- Adds TypeScript definitions1b8940e
- Adds ability to override the redirect path on login and logout (#84)
Fixes
Breaking Changes
ce3fcb3
- Scopes are now passed as a space separatedString
0c62752
- Requesting an access token and/or id token returns theirString
value instead of the object (#75, #106)ba85754
- MakeisAuthenticated
async2f82adc
- Removes the ability to retrieve theokta-auth-js
object. (#105)
Migration
oktaAuth.loginRedirect
didn't require a path parameter in previous versions of this library. In order to achieve custom redirecting, we've introduced the ability to pass in a custom route that navigates users to on completion.
Note: These changes are only needed when passing additionalParameters
to the method.
// Before
this.oktaAuth.loginRedirect({
sessionToken: /* sessionToken */
})
// Now
this.oktaAuth.loginRedirect('/profile', {
sessionToken: /* sessionToken */
})
Since scopes
are no longer allowed to be passed as an Array
, update your configuration's scope
value to be a String
:
const config = {
issuer: 'https://{yourOktaDomain}.com/oauth2/default',
...
scope: 'openid email profile'
}
Prior usage of getAccessToken()
or getIdToken()
would return a token object. Token String
values are now returned asynchronously:
// Before
const accessToken = this.oktaAuth.getAccessToken().accessToken;
// Now
const accessToken = await this.oktaAuth.getAccessToken();
Due to the above change, isAuthenticated
is also async
:
// Before
const loggedIn = this.oktaAuth.isAuthenticated();
// Now
const loggedIn = await this.oktaAuth.isAuthenticated();