@asgardeo/auth-spa 0.2.13 → 0.2.17

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.
Files changed (47) hide show
  1. package/README.md +9 -4
  2. package/dist/asgardeo-spa.production.esm.js +10 -10
  3. package/dist/asgardeo-spa.production.esm.js.map +1 -1
  4. package/dist/asgardeo-spa.production.js +7 -7
  5. package/dist/asgardeo-spa.production.js.map +1 -1
  6. package/dist/asgardeo-spa.production.min.js +1 -1
  7. package/dist/asgardeo-spa.production.min.js.map +1 -1
  8. package/dist/polyfilled/asgardeo-spa.production.esm.js +35 -35
  9. package/dist/polyfilled/asgardeo-spa.production.esm.js.map +1 -1
  10. package/dist/polyfilled/asgardeo-spa.production.js +35 -35
  11. package/dist/polyfilled/asgardeo-spa.production.js.map +1 -1
  12. package/dist/polyfilled/asgardeo-spa.production.min.js +1 -1
  13. package/dist/polyfilled/asgardeo-spa.production.min.js.map +1 -1
  14. package/dist/src/client.js.map +1 -1
  15. package/dist/src/clients/main-thread-client.d.ts.map +1 -1
  16. package/dist/src/clients/main-thread-client.js +131 -54
  17. package/dist/src/clients/main-thread-client.js.map +1 -1
  18. package/dist/src/clients/web-worker-client.d.ts.map +1 -1
  19. package/dist/src/clients/web-worker-client.js +42 -19
  20. package/dist/src/clients/web-worker-client.js.map +1 -1
  21. package/dist/src/constants/parameters.d.ts +1 -0
  22. package/dist/src/constants/parameters.d.ts.map +1 -1
  23. package/dist/src/constants/parameters.js +1 -0
  24. package/dist/src/constants/parameters.js.map +1 -1
  25. package/dist/src/models/client.d.ts +2 -2
  26. package/dist/src/models/client.d.ts.map +1 -1
  27. package/dist/src/models/http-client.d.ts +1 -1
  28. package/dist/src/models/http-client.d.ts.map +1 -1
  29. package/dist/src/models/web-worker.d.ts +1 -2
  30. package/dist/src/models/web-worker.d.ts.map +1 -1
  31. package/dist/src/worker/client.worker.d.ts.map +1 -1
  32. package/dist/src/worker/client.worker.js +1 -7
  33. package/dist/src/worker/client.worker.js.map +1 -1
  34. package/dist/src/worker/worker-core.d.ts.map +1 -1
  35. package/dist/src/worker/worker-core.js +20 -7
  36. package/dist/src/worker/worker-core.js.map +1 -1
  37. package/dist/tsconfig.tsbuildinfo +1 -1
  38. package/package.json +6 -6
  39. package/src/client.ts +1 -1
  40. package/src/clients/main-thread-client.ts +156 -77
  41. package/src/clients/web-worker-client.ts +50 -24
  42. package/src/constants/parameters.ts +1 -0
  43. package/src/models/client.ts +2 -2
  44. package/src/models/http-client.ts +1 -1
  45. package/src/models/web-worker.ts +1 -2
  46. package/src/worker/client.worker.ts +3 -12
  47. package/src/worker/worker-core.ts +20 -8
package/README.md CHANGED
@@ -61,6 +61,10 @@
61
61
 
62
62
  Asgardeo Auth SPA SDK for JavaScript allows Single Page Applications to use OIDC or OAuth2 authentication in a simple and secure way. By using Asgardeo and the JavaScript SPA SDK, developers will be able to add identity management to their Single Page Applications in a jiffy.
63
63
 
64
+ ## Prerequisite
65
+
66
+ Create an organization in Asgardeo if you don't already have one. The organization name you choose will be referred to as `<org_name>` throughout this document.
67
+
64
68
  ## Install
65
69
 
66
70
  Install the JavaScript library from the npm registry.
@@ -92,7 +96,7 @@ auth.initialize({
92
96
  signInRedirectURL: "http://localhost:3000/sign-in",
93
97
  signOutRedirectURL: "http://localhost:3000/dashboard",
94
98
  clientID: "client ID",
95
- serverOrigin: "https://api.asgardeo.io"
99
+ serverOrigin: "https://api.asgardeo.io/t/<org_name>"
96
100
  });
97
101
 
98
102
  // To sign in, simply call the `signIn()` method.
@@ -119,7 +123,7 @@ auth.initialize({
119
123
  signInRedirectURL: "http://localhost:3000/sign-in",
120
124
  signOutRedirectURL: "http://localhost:3000/dashboard",
121
125
  clientID: "client ID",
122
- serverOrigin: "https://api.asgardeo.io"
126
+ serverOrigin: "https://api.asgardeo.io/t/<org_name>"
123
127
  });
124
128
 
125
129
  // To sign in, simply call the `signIn()` method.
@@ -276,7 +280,7 @@ const config = {
276
280
  signInRedirectURL: "http://localhost:3000/sign-in",
277
281
  signOutRedirectURL: "http://localhost:3000/dashboard",
278
282
  clientID: "client ID",
279
- serverOrigin: "https://api.asgardeo.io"
283
+ serverOrigin: "https://api.asgardeo.io/t/<org_name>"
280
284
  }
281
285
 
282
286
  auth.initialize(config);
@@ -927,7 +931,7 @@ This table shows the extended attributes provided by the `Config` interface.
927
931
  | `prompt` | Optional | `string` | "" | Specifies the prompt type of an OIDC request |
928
932
  | `responseMode` | Optional | `ResponseMode` | `"query"` | Specifies the response mode. The value can either be `query` or `form_post` |
929
933
  | `scope` | Optional | `string[]` | `["openid"]` | Specifies the requested scopes. |
930
- | `serverOrigin` | Required | `string` | "" | The origin of the Identity Provider. eg: `https://www.asgardeo.io` |
934
+ | `serverOrigin` | Required | `string` | "" | The origin of the Identity Provider. eg: `https://api.asgardeo.io/t/<org_name>` |
931
935
  | `endpoints` | Optional | `OIDCEndpoints` | [OIDC Endpoints Default Values](#oidc-endpoints) | The OIDC endpoint URLs. The SDK will try to obtain the endpoint URLS | using the `.well-known` endpoint. If this fails, the SDK will use these endpoint URLs. If this attribute is not set, then the default endpoint URLs will be | used. However, if the `overrideWellEndpointConfig` is set to `true`, then this will override the endpoints obtained from the `.well-known` endpoint. |
932
936
  | `overrideWellEndpointConfig` | Optional | `boolean` | `false` | If this option is set to `true`, then the `endpoints` object will override endpoints obtained | from the `.well-known` endpoint. If this is set to `false`, then this will be used as a fallback if the request to the `.well-known` endpoint fails. |
933
937
  | `wellKnownEndpoint` | Optional | `string` | `"/oauth2/token/.well-known/openid-configuration"` | The URL of the `.well-known` endpoint. |
@@ -944,6 +948,7 @@ This table shows the extended attributes provided by the `Config` interface.
944
948
  | `allowedScopes` | `string` | The scopes allowed for the user. |
945
949
  | `tenantDomain` | `string` | The tenant domain to which the user belongs. |
946
950
  | `sessionState` | `string` | The session state. |
951
+ | `sub` | `string` | The `uid` corresponding to the user to whom the ID token belongs to. |
947
952
 
948
953
  ### SignInConfig
949
954