@asgardeo/auth-react 0.2.2 → 0.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -43,7 +43,7 @@
43
43
  - [Storage](#storage)
44
44
  - [Models](#models)
45
45
  - [AuthStateInterface](#authstateinterface)
46
- - [AuthClientConfig\<Config>](#authclientconfigconfig)
46
+ - [AuthReactConfig>](#authreactconfig)
47
47
  - [BasicUserInfo](#basicuserinfo)
48
48
  - [SignInConfig](#signinconfig)
49
49
  - [OIDCEndpoints](#oidcendpoints)
@@ -191,6 +191,10 @@ The provider takes a prop called `config` that accepts a config object of type [
191
191
 
192
192
  In addition, the `fallback` prop is used to specify a fallback component that will be rendered when the user is not authenticated.
193
193
 
194
+ The `AuthProvider` also automatically requests for the access token should the URL contain the `code` query parameter.
195
+
196
+ If the response mode is set to `form_post`, then you will have your own ways of retrieving the authorization code and session state from your backend. In that case, you can use the `getAuthParams()` prop method to pass an async callback function that would return the `authorizationCode` and `sessionState` in a Promise. This way, the `AuthProvider` will use the authorization code returned by this method to automatically request for an access token.
197
+
194
198
  #### Example
195
199
 
196
200
  ```TypeScript
@@ -850,18 +854,7 @@ initialize(config);
850
854
  | `isLoading` | `boolean` | Specifies if the authentication requests are loading. |
851
855
  | `username` | `string` | The username of the user. |
852
856
 
853
- ### AuthClientConfig\<Config>
854
-
855
- The `AuthClientConfig<Config>` interface extends the `AuthClientConfig<T>` interface provided by the `Asgardeo JavaScript Auth SDK` with the `Config` interface. This table lists the attributes that the `AuthClientConfig<T>` interface takes.
856
-
857
- This table shows the extended attributes provided by the `Config` interface.
858
- | Attribute | Required/Optional | Type | Default Value | Description |
859
- |:----|:----|:----|:----|:----|
860
- | [`storage`](#storage) | Optional | `"sessionStorage"`, `"webWorker"`, `"localStorage"` | `"sessionStorage"` | The storage medium where the session information such as the access token should be stored.| |
861
- | `resourceServerURLs` |Required if the `storage` is set to `webWorker` | `string[]` | `[]` | The URLs of the API endpoints. This is needed only if the storage method is set to `webWorker`. When API calls are made through the [`httpRequest`](#httprequest) or the [`httpRequestAll`](#httprequestall) method, only the calls to the endpoints specified in the `baseURL` attribute will be allowed. Everything else will be denied. | |
862
- |`requestTimeout` | Optional | `number`| 60000 (seconds) | Specifies in seconds how long a request to the web worker should wait before being timed out. |
863
-
864
- #### The AuthClientConfig Interface
857
+ ### AuthReactConfig
865
858
 
866
859
  | Attribute | Required/Optional | Type | Default Value | Description |
867
860
  | --------- | ----------------- | ---- | ------------- | ----------- |
@@ -881,6 +874,11 @@ This table shows the extended attributes provided by the `Config` interface.
881
874
  | `validateIDToken` | Optional | `boolean` | `true` | Allows you to enable/disable JWT ID token validation after obtaining the ID token. |
882
875
  | `clockTolerance` | Optional | `number` | `60` | Allows you to configure the leeway when validating the id_token. |
883
876
  | `skipRedirectCallback` | Optional | `boolean` | `false` | Stop listening to Auth param changes i.e `code` & `session_state` to trigger auto login. |
877
+ | [`storage`](#storage) | Optional | `"sessionStorage"`, `"webWorker"`, `"localStorage"` | `"sessionStorage"` | The storage medium where the session information such as the access token should be stored.| |
878
+ | `resourceServerURLs` |Required if the `storage` is set to `webWorker` | `string[]` | `[]` | The URLs of the API endpoints. This is needed only if the storage method is set to `webWorker`. When API calls are made through the [`httpRequest`](#httprequest) or the [`httpRequestAll`](#httprequestall) method, only the calls to the endpoints specified in the `baseURL` attribute will be allowed. Everything else will be denied. | |
879
+ |`requestTimeout` | Optional | `number`| 60000 (seconds) | Specifies in seconds how long a request to the web worker should wait before being timed out. |
880
+ | `disableTrySignInSilently` | Optional | `boolean` | `false` | Specifies if the SDK should try to sign in silently on mount.|
881
+ |`enableOIDCSessionManagement` |Optional|`boolean`| false | Flag to enable OIDC Session Management |
884
882
 
885
883
  ### BasicUserInfo
886
884
 
@@ -899,6 +897,7 @@ This table shows the extended attributes provided by the `Config` interface.
899
897
  | ------------- | ----------------- | --------------------- | ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
900
898
  | `fidp` | Optional | `string` | "" | The `fidp` parameter that can be used to redirect a user directly to an IdP's sign-in page. |
901
899
  | `forceInit` | Optional | `boolean` | `false` | Forces obtaining the OIDC endpoints from the `.well-known` endpoint. A request to this endpoint is not sent if a request has already been sent. This forces a request. |
900
+ | `callOnlyOnRedirect` | Optional | `boolean` | `false` | Specifies if the SDK should only call the `signIn` method when the user is redirected back to the client app. |
902
901
  | key: `string` | Optional | `string` \| `boolean` | "" | Any key-value pair to be appended as path parameters to the authorization URL. |
903
902
 
904
903
  ### OIDCEndpoints