@okta/okta-auth-js 7.1.1 → 7.3.0

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 (264) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/README.md +101 -39
  3. package/cjs/core/mixin.js +3 -0
  4. package/cjs/core/mixin.js.map +1 -1
  5. package/cjs/core/types/api.js.map +1 -1
  6. package/cjs/http/OktaUserAgent.js +2 -2
  7. package/cjs/idx/IdxTransactionManager.js +0 -4
  8. package/cjs/idx/IdxTransactionManager.js.map +1 -1
  9. package/cjs/idx/factory/OktaAuthIdx.js.map +1 -1
  10. package/cjs/idx/idxState/v1/idxResponseParser.js +2 -3
  11. package/cjs/idx/idxState/v1/idxResponseParser.js.map +1 -1
  12. package/cjs/idx/mixin.js.map +1 -1
  13. package/cjs/idx/types/api.js.map +1 -1
  14. package/cjs/idx/webauthn.js.map +1 -1
  15. package/cjs/myaccount/api.js +11 -0
  16. package/cjs/myaccount/api.js.map +1 -1
  17. package/cjs/myaccount/emailApi.js +7 -7
  18. package/cjs/myaccount/emailApi.js.map +1 -1
  19. package/cjs/myaccount/passwordApi.js +69 -0
  20. package/cjs/myaccount/passwordApi.js.map +1 -0
  21. package/cjs/myaccount/phoneApi.js +6 -6
  22. package/cjs/myaccount/phoneApi.js.map +1 -1
  23. package/cjs/myaccount/profileApi.js +3 -3
  24. package/cjs/myaccount/profileApi.js.map +1 -1
  25. package/cjs/myaccount/request.js +3 -4
  26. package/cjs/myaccount/request.js.map +1 -1
  27. package/cjs/myaccount/transactions/PasswordTransaction.js +81 -0
  28. package/cjs/myaccount/transactions/PasswordTransaction.js.map +1 -0
  29. package/cjs/myaccount/transactions/index.js +7 -0
  30. package/cjs/myaccount/transactions/index.js.map +1 -1
  31. package/cjs/myaccount/types.js +13 -0
  32. package/cjs/myaccount/types.js.map +1 -1
  33. package/cjs/oidc/TokenManager.js +5 -0
  34. package/cjs/oidc/TokenManager.js.map +1 -1
  35. package/cjs/oidc/endpoints/authorize.js +4 -3
  36. package/cjs/oidc/endpoints/authorize.js.map +1 -1
  37. package/cjs/oidc/enrollAuthenticator.js +33 -0
  38. package/cjs/oidc/enrollAuthenticator.js.map +1 -0
  39. package/cjs/oidc/factory/api.js +11 -11
  40. package/cjs/oidc/factory/api.js.map +1 -1
  41. package/cjs/oidc/getWithRedirect.js +5 -1
  42. package/cjs/oidc/getWithRedirect.js.map +1 -1
  43. package/cjs/oidc/handleOAuthResponse.js +3 -2
  44. package/cjs/oidc/handleOAuthResponse.js.map +1 -1
  45. package/cjs/oidc/mixin/index.js +10 -4
  46. package/cjs/oidc/mixin/index.js.map +1 -1
  47. package/cjs/oidc/types/TokenManager.js.map +1 -1
  48. package/cjs/oidc/types/api.js.map +1 -1
  49. package/cjs/oidc/types/endpoints.js +2 -0
  50. package/cjs/oidc/types/endpoints.js.map +1 -0
  51. package/cjs/oidc/types/index.js +11 -0
  52. package/cjs/oidc/types/index.js.map +1 -1
  53. package/cjs/oidc/types/meta.js.map +1 -1
  54. package/cjs/oidc/types/options.js.map +1 -1
  55. package/cjs/oidc/types/proto.js.map +1 -1
  56. package/cjs/oidc/util/defaultEnrollAuthenticatorParams.js +38 -0
  57. package/cjs/oidc/util/defaultEnrollAuthenticatorParams.js.map +1 -0
  58. package/cjs/oidc/util/enrollAuthenticatorMeta.js +23 -0
  59. package/cjs/oidc/util/enrollAuthenticatorMeta.js.map +1 -0
  60. package/cjs/oidc/util/index.js +36 -0
  61. package/cjs/oidc/util/index.js.map +1 -1
  62. package/cjs/oidc/util/prepareEnrollAuthenticatorParams.js +50 -0
  63. package/cjs/oidc/util/prepareEnrollAuthenticatorParams.js.map +1 -0
  64. package/cjs/services/AutoRenewService.js +16 -2
  65. package/cjs/services/AutoRenewService.js.map +1 -1
  66. package/cjs/services/LeaderElectionService.js +1 -2
  67. package/cjs/services/LeaderElectionService.js.map +1 -1
  68. package/cjs/services/SyncStorageService.js +1 -2
  69. package/cjs/services/SyncStorageService.js.map +1 -1
  70. package/cjs/session/mixin.js +2 -1
  71. package/cjs/session/mixin.js.map +1 -1
  72. package/cjs/session/types.js.map +1 -1
  73. package/cjs/storage/BaseStorageManager.js +1 -1
  74. package/cjs/storage/BaseStorageManager.js.map +1 -1
  75. package/cjs/util/jsonpath.js +13 -0
  76. package/cjs/util/jsonpath.js.map +1 -0
  77. package/dist/okta-auth-js.authn.min.analyzer.html +2 -2
  78. package/dist/okta-auth-js.authn.min.js +1 -1
  79. package/dist/okta-auth-js.authn.min.js.map +1 -1
  80. package/dist/okta-auth-js.core.min.analyzer.html +2 -2
  81. package/dist/okta-auth-js.core.min.js +1 -1
  82. package/dist/okta-auth-js.core.min.js.map +1 -1
  83. package/dist/okta-auth-js.idx.min.analyzer.html +2 -2
  84. package/dist/okta-auth-js.idx.min.js +1 -1
  85. package/dist/okta-auth-js.idx.min.js.map +1 -1
  86. package/dist/okta-auth-js.min.analyzer.html +2 -2
  87. package/dist/okta-auth-js.min.js +1 -1
  88. package/dist/okta-auth-js.min.js.map +1 -1
  89. package/dist/okta-auth-js.myaccount.min.analyzer.html +2 -2
  90. package/dist/okta-auth-js.myaccount.min.js +1 -1
  91. package/dist/okta-auth-js.myaccount.min.js.map +1 -1
  92. package/esm/browser/core/mixin.js +3 -0
  93. package/esm/browser/core/mixin.js.map +1 -1
  94. package/esm/browser/exports/exports/authn.js +4 -1
  95. package/esm/browser/exports/exports/authn.js.map +1 -1
  96. package/esm/browser/exports/exports/core.js +4 -1
  97. package/esm/browser/exports/exports/core.js.map +1 -1
  98. package/esm/browser/exports/exports/default.js +7 -2
  99. package/esm/browser/exports/exports/default.js.map +1 -1
  100. package/esm/browser/exports/exports/idx.js +4 -1
  101. package/esm/browser/exports/exports/idx.js.map +1 -1
  102. package/esm/browser/exports/exports/myaccount.js +7 -2
  103. package/esm/browser/exports/exports/myaccount.js.map +1 -1
  104. package/esm/browser/http/OktaUserAgent.js +2 -2
  105. package/esm/browser/idx/IdxTransactionManager.js +1 -4
  106. package/esm/browser/idx/IdxTransactionManager.js.map +1 -1
  107. package/esm/browser/idx/factory/OktaAuthIdx.js.map +1 -1
  108. package/esm/browser/idx/idxState/v1/idxResponseParser.js +2 -2
  109. package/esm/browser/idx/idxState/v1/idxResponseParser.js.map +1 -1
  110. package/esm/browser/idx/mixin.js.map +1 -1
  111. package/esm/browser/idx/types/api.js.map +1 -1
  112. package/esm/browser/idx/webauthn.js.map +1 -1
  113. package/esm/browser/myaccount/api.js +1 -0
  114. package/esm/browser/myaccount/api.js.map +1 -1
  115. package/esm/browser/myaccount/emailApi.js.map +1 -1
  116. package/esm/browser/myaccount/passwordApi.js +56 -0
  117. package/esm/browser/myaccount/passwordApi.js.map +1 -0
  118. package/esm/browser/myaccount/phoneApi.js.map +1 -1
  119. package/esm/browser/myaccount/profileApi.js.map +1 -1
  120. package/esm/browser/myaccount/request.js +4 -2
  121. package/esm/browser/myaccount/request.js.map +1 -1
  122. package/esm/browser/myaccount/transactions/PasswordTransaction.js +73 -0
  123. package/esm/browser/myaccount/transactions/PasswordTransaction.js.map +1 -0
  124. package/esm/browser/myaccount/types.js +6 -1
  125. package/esm/browser/myaccount/types.js.map +1 -1
  126. package/esm/browser/oidc/TokenManager.js +5 -0
  127. package/esm/browser/oidc/TokenManager.js.map +1 -1
  128. package/esm/browser/oidc/endpoints/authorize.js +3 -2
  129. package/esm/browser/oidc/endpoints/authorize.js.map +1 -1
  130. package/esm/browser/oidc/enrollAuthenticator.js +36 -0
  131. package/esm/browser/oidc/enrollAuthenticator.js.map +1 -0
  132. package/esm/browser/oidc/factory/api.js +10 -12
  133. package/esm/browser/oidc/factory/api.js.map +1 -1
  134. package/esm/browser/oidc/getWithRedirect.js +6 -1
  135. package/esm/browser/oidc/getWithRedirect.js.map +1 -1
  136. package/esm/browser/oidc/handleOAuthResponse.js +3 -2
  137. package/esm/browser/oidc/handleOAuthResponse.js.map +1 -1
  138. package/esm/browser/oidc/mixin/index.js +9 -4
  139. package/esm/browser/oidc/mixin/index.js.map +1 -1
  140. package/esm/browser/oidc/types/TokenManager.js.map +1 -1
  141. package/esm/browser/oidc/util/defaultEnrollAuthenticatorParams.js +31 -0
  142. package/esm/browser/oidc/util/defaultEnrollAuthenticatorParams.js.map +1 -0
  143. package/esm/browser/oidc/util/enrollAuthenticatorMeta.js +33 -0
  144. package/esm/browser/oidc/util/enrollAuthenticatorMeta.js.map +1 -0
  145. package/esm/browser/oidc/util/prepareEnrollAuthenticatorParams.js +34 -0
  146. package/esm/browser/oidc/util/prepareEnrollAuthenticatorParams.js.map +1 -0
  147. package/esm/browser/package.json +1 -1
  148. package/esm/browser/services/AutoRenewService.js +15 -2
  149. package/esm/browser/services/AutoRenewService.js.map +1 -1
  150. package/esm/browser/services/LeaderElectionService.js +1 -2
  151. package/esm/browser/services/LeaderElectionService.js.map +1 -1
  152. package/esm/browser/services/SyncStorageService.js +1 -2
  153. package/esm/browser/services/SyncStorageService.js.map +1 -1
  154. package/esm/browser/session/mixin.js +2 -1
  155. package/esm/browser/session/mixin.js.map +1 -1
  156. package/esm/browser/storage/BaseStorageManager.js +1 -1
  157. package/esm/browser/storage/BaseStorageManager.js.map +1 -1
  158. package/esm/browser/util/jsonpath.js +21 -0
  159. package/esm/browser/util/jsonpath.js.map +1 -0
  160. package/esm/node/core/mixin.js +3 -0
  161. package/esm/node/core/mixin.js.map +1 -1
  162. package/esm/node/exports/exports/authn.js +4 -1
  163. package/esm/node/exports/exports/authn.js.map +1 -1
  164. package/esm/node/exports/exports/core.js +4 -1
  165. package/esm/node/exports/exports/core.js.map +1 -1
  166. package/esm/node/exports/exports/default.js +7 -2
  167. package/esm/node/exports/exports/default.js.map +1 -1
  168. package/esm/node/exports/exports/idx.js +4 -1
  169. package/esm/node/exports/exports/idx.js.map +1 -1
  170. package/esm/node/exports/exports/myaccount.js +7 -2
  171. package/esm/node/exports/exports/myaccount.js.map +1 -1
  172. package/esm/node/http/OktaUserAgent.js +2 -2
  173. package/esm/node/idx/IdxTransactionManager.js +1 -4
  174. package/esm/node/idx/IdxTransactionManager.js.map +1 -1
  175. package/esm/node/idx/factory/OktaAuthIdx.js.map +1 -1
  176. package/esm/node/idx/idxState/v1/idxResponseParser.js +2 -2
  177. package/esm/node/idx/idxState/v1/idxResponseParser.js.map +1 -1
  178. package/esm/node/idx/mixin.js.map +1 -1
  179. package/esm/node/idx/types/api.js.map +1 -1
  180. package/esm/node/idx/webauthn.js.map +1 -1
  181. package/esm/node/myaccount/api.js +1 -0
  182. package/esm/node/myaccount/api.js.map +1 -1
  183. package/esm/node/myaccount/emailApi.js.map +1 -1
  184. package/esm/node/myaccount/passwordApi.js +56 -0
  185. package/esm/node/myaccount/passwordApi.js.map +1 -0
  186. package/esm/node/myaccount/phoneApi.js.map +1 -1
  187. package/esm/node/myaccount/profileApi.js.map +1 -1
  188. package/esm/node/myaccount/request.js +4 -2
  189. package/esm/node/myaccount/request.js.map +1 -1
  190. package/esm/node/myaccount/transactions/PasswordTransaction.js +73 -0
  191. package/esm/node/myaccount/transactions/PasswordTransaction.js.map +1 -0
  192. package/esm/node/myaccount/types.js +6 -1
  193. package/esm/node/myaccount/types.js.map +1 -1
  194. package/esm/node/oidc/TokenManager.js +5 -0
  195. package/esm/node/oidc/TokenManager.js.map +1 -1
  196. package/esm/node/oidc/endpoints/authorize.js +3 -2
  197. package/esm/node/oidc/endpoints/authorize.js.map +1 -1
  198. package/esm/node/oidc/enrollAuthenticator.js +37 -0
  199. package/esm/node/oidc/enrollAuthenticator.js.map +1 -0
  200. package/esm/node/oidc/factory/api.js +10 -12
  201. package/esm/node/oidc/factory/api.js.map +1 -1
  202. package/esm/node/oidc/getWithRedirect.js +6 -1
  203. package/esm/node/oidc/getWithRedirect.js.map +1 -1
  204. package/esm/node/oidc/handleOAuthResponse.js +3 -2
  205. package/esm/node/oidc/handleOAuthResponse.js.map +1 -1
  206. package/esm/node/oidc/mixin/index.js +9 -4
  207. package/esm/node/oidc/mixin/index.js.map +1 -1
  208. package/esm/node/oidc/types/TokenManager.js.map +1 -1
  209. package/esm/node/oidc/util/defaultEnrollAuthenticatorParams.js +31 -0
  210. package/esm/node/oidc/util/defaultEnrollAuthenticatorParams.js.map +1 -0
  211. package/esm/node/oidc/util/enrollAuthenticatorMeta.js +33 -0
  212. package/esm/node/oidc/util/enrollAuthenticatorMeta.js.map +1 -0
  213. package/esm/node/oidc/util/prepareEnrollAuthenticatorParams.js +34 -0
  214. package/esm/node/oidc/util/prepareEnrollAuthenticatorParams.js.map +1 -0
  215. package/esm/node/package.json +1 -1
  216. package/esm/node/session/mixin.js +2 -1
  217. package/esm/node/session/mixin.js.map +1 -1
  218. package/esm/node/storage/BaseStorageManager.js +1 -1
  219. package/esm/node/storage/BaseStorageManager.js.map +1 -1
  220. package/esm/node/util/jsonpath.js +21 -0
  221. package/esm/node/util/jsonpath.js.map +1 -0
  222. package/package.json +9 -7
  223. package/types/lib/core/types/api.d.ts +1 -0
  224. package/types/lib/exports/default.d.ts +1 -1
  225. package/types/lib/exports/idx.d.ts +1 -1
  226. package/types/lib/idx/factory/OktaAuthIdx.d.ts +3 -3
  227. package/types/lib/idx/mixin.d.ts +2 -2
  228. package/types/lib/idx/types/api.d.ts +13 -1
  229. package/types/lib/idx/webauthn.d.ts +1 -7
  230. package/types/lib/myaccount/api.d.ts +1 -0
  231. package/types/lib/myaccount/emailApi.d.ts +7 -7
  232. package/types/lib/myaccount/passwordApi.d.ts +17 -0
  233. package/types/lib/myaccount/phoneApi.d.ts +6 -6
  234. package/types/lib/myaccount/profileApi.d.ts +3 -3
  235. package/types/lib/myaccount/transactions/PasswordTransaction.d.ts +13 -0
  236. package/types/lib/myaccount/transactions/index.d.ts +1 -0
  237. package/types/lib/myaccount/types.d.ts +17 -2
  238. package/types/lib/oidc/TokenManager.d.ts +1 -0
  239. package/types/lib/oidc/enrollAuthenticator.d.ts +14 -0
  240. package/types/lib/oidc/factory/api.d.ts +2 -1
  241. package/types/lib/oidc/types/TokenManager.d.ts +1 -0
  242. package/types/lib/oidc/types/api.d.ts +6 -5
  243. package/types/lib/oidc/types/endpoints.d.ts +18 -0
  244. package/types/lib/oidc/types/index.d.ts +1 -0
  245. package/types/lib/oidc/types/meta.d.ts +1 -1
  246. package/types/lib/oidc/types/options.d.ts +6 -1
  247. package/types/lib/oidc/types/proto.d.ts +1 -0
  248. package/types/lib/oidc/util/defaultEnrollAuthenticatorParams.d.ts +2 -0
  249. package/types/lib/oidc/util/enrollAuthenticatorMeta.d.ts +2 -0
  250. package/types/lib/oidc/util/index.d.ts +3 -0
  251. package/types/lib/oidc/util/prepareEnrollAuthenticatorParams.d.ts +2 -0
  252. package/types/lib/services/AutoRenewService.d.ts +1 -0
  253. package/types/lib/session/types.d.ts +1 -1
  254. package/types/lib/util/jsonpath.d.ts +2 -0
  255. package/umd/authn.js +1 -1
  256. package/umd/authn.js.map +1 -1
  257. package/umd/core.js +1 -1
  258. package/umd/core.js.map +1 -1
  259. package/umd/default.js +1 -1
  260. package/umd/default.js.map +1 -1
  261. package/umd/idx.js +1 -1
  262. package/umd/idx.js.map +1 -1
  263. package/umd/myaccount.js +1 -1
  264. package/umd/myaccount.js.map +1 -1
@@ -22,10 +22,11 @@ function mixinSession(Base) {
22
22
  return this.session.close()
23
23
  .then(async () => {
24
24
  this.clearStorage();
25
+ return true;
25
26
  })
26
27
  .catch(function (e) {
27
28
  if (e.name === 'AuthApiError' && e.errorCode === 'E0000007') {
28
- return null;
29
+ return false;
29
30
  }
30
31
  throw e;
31
32
  });
@@ -1 +1 @@
1
- {"version":3,"file":"mixin.js","sources":["../../../../lib/session/mixin.ts"],"sourcesContent":["import { OktaAuthHttpInterface, OktaAuthHttpOptions } from '../http/types';\nimport { OktaAuthConstructor } from '../base/types';\nimport { createSessionApi } from './factory';\nimport {\n OktaAuthSessionInterface, SessionAPI,\n} from './types';\nimport { StorageManagerInterface } from '../storage/types';\n\nexport function mixinSession\n<\n S extends StorageManagerInterface = StorageManagerInterface,\n O extends OktaAuthHttpOptions = OktaAuthHttpOptions,\n TBase extends OktaAuthConstructor<OktaAuthHttpInterface<S, O>>\n = OktaAuthConstructor<OktaAuthHttpInterface<S, O>>\n>\n(Base: TBase): TBase & OktaAuthConstructor<OktaAuthSessionInterface<S, O>>\n{\n return class OktaAuthSession extends Base implements OktaAuthSessionInterface<S, O>\n {\n session: SessionAPI;\n\n constructor(...args: any[]) {\n super(...args);\n\n this.session = createSessionApi(this);\n }\n\n // Ends the current Okta SSO session without redirecting to Okta.\n closeSession(): Promise<unknown> {\n return this.session.close() // DELETE /api/v1/sessions/me\n .then(async () => {\n // Clear all local tokens\n this.clearStorage();\n })\n .catch(function(e) {\n if (e.name === 'AuthApiError' && e.errorCode === 'E0000007') {\n // Session does not exist or has already been closed\n return null;\n }\n throw e;\n });\n }\n };\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAQM,CAAU,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,CAO3B,CAAA,CAAA,CAAA,CAAW,CAAA,CAAA,CAAA;IAEV,CAAO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAgB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,IAAI,CAAA,CAAA;AAIvC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAW,CAAA,CAAA,CAAA;AACxB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,CAAA,CAAA,CAAA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CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAc,CAAI,CAAA,CAAA,CAAA,CAAC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAS,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAU,CAAE,CAAA,CAAA;AAE3D,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,IAAI,CAAC;AACb,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AACD,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAC,CAAC;AACV,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAC,CAAC,CAAC;CACJ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;KACF,CAAC;AACJ,CAAA;;"}
1
+ {"version":3,"file":"mixin.js","sources":["../../../../lib/session/mixin.ts"],"sourcesContent":["import { OktaAuthHttpInterface, OktaAuthHttpOptions } from '../http/types';\nimport { OktaAuthConstructor } from '../base/types';\nimport { createSessionApi } from './factory';\nimport {\n OktaAuthSessionInterface, SessionAPI,\n} from './types';\nimport { StorageManagerInterface } from '../storage/types';\n\nexport function mixinSession\n<\n S extends StorageManagerInterface = StorageManagerInterface,\n O extends OktaAuthHttpOptions = OktaAuthHttpOptions,\n TBase extends OktaAuthConstructor<OktaAuthHttpInterface<S, O>>\n = OktaAuthConstructor<OktaAuthHttpInterface<S, O>>\n>\n(Base: TBase): TBase & OktaAuthConstructor<OktaAuthSessionInterface<S, O>>\n{\n return class OktaAuthSession extends Base implements OktaAuthSessionInterface<S, O>\n {\n session: SessionAPI;\n\n constructor(...args: any[]) {\n super(...args);\n\n this.session = createSessionApi(this);\n }\n\n // Ends the current Okta SSO session without redirecting to Okta.\n closeSession(): Promise<boolean> {\n return this.session.close() // DELETE /api/v1/sessions/me\n .then(async () => {\n // Clear all local tokens\n this.clearStorage();\n return true;\n })\n .catch(function(e) {\n if (e.name === 'AuthApiError' && e.errorCode === 'E0000007') {\n // Session does not exist or has already been closed\n return false;\n }\n throw e;\n });\n }\n };\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAQM,CAAU,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,CAO3B,CAAA,CAAA,CAAA,CAAW,CAAA,CAAA,CAAA;IAEV,CAAO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAgB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,IAAI,CAAA,CAAA;AAIvC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAW,CAAA,CAAA,CAAA;AACxB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,CAAA,CAAA,CAAA,CAAA,CAAC,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,C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A,CAAA,CAAA,CAAC,CAAC,CAAA,CAAA,CAAA,CAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAc,CAAI,CAAA,CAAA,CAAA,CAAC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAS,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAU,CAAE,CAAA,CAAA;AAE3D,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,KAAK,CAAC;AACd,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AACD,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAC,CAAC;AACV,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAC,CAAC,CAAC;CACJ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;KACF,CAAC;AACJ,CAAA;;"}
@@ -16,7 +16,7 @@ import { isBrowser } from '../features.js';
16
16
  import { warn } from '../util/console.js';
17
17
 
18
18
  function logServerSideMemoryStorageWarning(options) {
19
- if (!isBrowser() && !options.storageProvider && !options.storageProvider) {
19
+ if (!isBrowser() && !options.storageProvider && !options.storageKey) {
20
20
  warn('Memory storage can only support simple single user use case on server side, please provide custom storageProvider or storageKey if advanced scenarios need to be supported.');
21
21
  }
22
22
  }
@@ -1 +1 @@
1
- {"version":3,"file":"BaseStorageManager.js","sources":["../../../../lib/storage/BaseStorageManager.ts"],"sourcesContent":["/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n\n\nimport {\n TOKEN_STORAGE_NAME,\n CACHE_STORAGE_NAME,\n} from '../constants';\nimport {\n StorageUtil,\n StorageProvider,\n StorageOptions,\n CookieOptions,\n StorageManagerOptions,\n SimpleStorage,\n StorageManagerInterface\n} from './types';\nimport { SavedObject } from './SavedObject';\nimport { isBrowser } from '../features';\nimport { warn } from '../util';\n\nexport function logServerSideMemoryStorageWarning(options: StorageOptions) {\n if (!isBrowser() && !options.storageProvider && !options.storageProvider) {\n // eslint-disable-next-line max-len\n warn('Memory storage can only support simple single user use case on server side, please provide custom storageProvider or storageKey if advanced scenarios need to be supported.');\n }\n}\n\n\nexport class BaseStorageManager implements StorageManagerInterface {\n storageManagerOptions: StorageManagerOptions;\n cookieOptions: CookieOptions;\n storageUtil: StorageUtil;\n\n constructor(storageManagerOptions: StorageManagerOptions, cookieOptions: CookieOptions, storageUtil: StorageUtil) {\n this.storageManagerOptions = storageManagerOptions;\n this.cookieOptions = cookieOptions;\n this.storageUtil = storageUtil;\n }\n\n // combines defaults in order\n getOptionsForSection(sectionName: string, overrideOptions?: StorageOptions) {\n return Object.assign({}, this.storageManagerOptions[sectionName], overrideOptions);\n }\n \n // generic method to get any available storage provider\n // eslint-disable-next-line complexity\n getStorage(options: StorageOptions): SimpleStorage {\n options = Object.assign({}, this.cookieOptions, options); // set defaults\n\n if (options.storageProvider) {\n return options.storageProvider;\n }\n\n let { storageType, storageTypes } = options;\n\n if(storageType === 'sessionStorage') {\n options.sessionCookie = true;\n }\n\n // If both storageType and storageTypes are specified, then storageType will be used first\n // If storageType cannot be used but it matches an entry in storageTypes, subsequent entries may be used as fallback\n // if storageType does not match an entry in storageTypes then storageType is used with no fallback.\n if (storageType && storageTypes) {\n const idx = storageTypes.indexOf(storageType);\n if (idx >= 0) {\n storageTypes = storageTypes.slice(idx);\n storageType = undefined;\n }\n }\n\n if (!storageType) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n storageType = this.storageUtil.findStorageType(storageTypes!);\n }\n return this.storageUtil.getStorageByType(storageType, options);\n }\n\n // access_token, id_token, refresh_token\n getTokenStorage(options?: StorageOptions): StorageProvider {\n options = this.getOptionsForSection('token', options);\n logServerSideMemoryStorageWarning(options);\n const storage = this.getStorage(options);\n const storageKey = options.storageKey || TOKEN_STORAGE_NAME;\n return new SavedObject(storage, storageKey);\n }\n\n // caches well-known response, among others\n getHttpCache(options?: StorageOptions): StorageProvider {\n options = this.getOptionsForSection('cache', options);\n const storage = this.getStorage(options);\n const storageKey = options.storageKey || CACHE_STORAGE_NAME;\n return new SavedObject(storage, storageKey);\n }\n\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AA+BM,CAAU,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAiC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAuB,CAAA,CAAA,CAAA;AACvE,CAAA,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAC,CAAS,CAAA,CAAA,CAAA,CAAA,CAAA,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AA,CAAA,CAAM,UAAU,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,CAAC,CAAU,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,kBAAkB,CAAC;AAC5D,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,IAAI,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAC,OAAO,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAU,CAAC,CAAC;CAC7C,CAAA,CAAA,CAAA,CAAA;AAEF,CAAA;;"}
1
+ {"version":3,"file":"BaseStorageManager.js","sources":["../../../../lib/storage/BaseStorageManager.ts"],"sourcesContent":["/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n\n\nimport {\n TOKEN_STORAGE_NAME,\n CACHE_STORAGE_NAME,\n} from '../constants';\nimport {\n StorageUtil,\n StorageProvider,\n StorageOptions,\n CookieOptions,\n StorageManagerOptions,\n SimpleStorage,\n StorageManagerInterface\n} from './types';\nimport { SavedObject } from './SavedObject';\nimport { isBrowser } from '../features';\nimport { warn } from '../util';\n\nexport function logServerSideMemoryStorageWarning(options: StorageOptions) {\n if (!isBrowser() && !options.storageProvider && !options.storageKey) {\n // eslint-disable-next-line max-len\n warn('Memory storage can only support simple single user use case on server side, please provide custom storageProvider or storageKey if advanced scenarios need to be supported.');\n }\n}\n\n\nexport class BaseStorageManager implements StorageManagerInterface {\n storageManagerOptions: StorageManagerOptions;\n cookieOptions: CookieOptions;\n storageUtil: StorageUtil;\n\n constructor(storageManagerOptions: StorageManagerOptions, cookieOptions: CookieOptions, storageUtil: StorageUtil) {\n this.storageManagerOptions = storageManagerOptions;\n this.cookieOptions = cookieOptions;\n this.storageUtil = storageUtil;\n }\n\n // combines defaults in order\n getOptionsForSection(sectionName: string, overrideOptions?: StorageOptions) {\n return Object.assign({}, this.storageManagerOptions[sectionName], overrideOptions);\n }\n \n // generic method to get any available storage provider\n // eslint-disable-next-line complexity\n getStorage(options: StorageOptions): SimpleStorage {\n options = Object.assign({}, this.cookieOptions, options); // set defaults\n\n if (options.storageProvider) {\n return options.storageProvider;\n }\n\n let { storageType, storageTypes } = options;\n\n if(storageType === 'sessionStorage') {\n options.sessionCookie = true;\n }\n\n // If both storageType and storageTypes are specified, then storageType will be used first\n // If storageType cannot be used but it matches an entry in storageTypes, subsequent entries may be used as fallback\n // if storageType does not match an entry in storageTypes then storageType is used with no fallback.\n if (storageType && storageTypes) {\n const idx = storageTypes.indexOf(storageType);\n if (idx >= 0) {\n storageTypes = storageTypes.slice(idx);\n storageType = undefined;\n }\n }\n\n if (!storageType) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n storageType = this.storageUtil.findStorageType(storageTypes!);\n }\n return this.storageUtil.getStorageByType(storageType, options);\n }\n\n // access_token, id_token, refresh_token\n getTokenStorage(options?: StorageOptions): StorageProvider {\n options = this.getOptionsForSection('token', options);\n logServerSideMemoryStorageWarning(options);\n const storage = this.getStorage(options);\n const storageKey = options.storageKey || TOKEN_STORAGE_NAME;\n return new SavedObject(storage, storageKey);\n }\n\n // caches well-known response, among others\n getHttpCache(options?: StorageOptions): StorageProvider {\n options = this.getOptionsForSection('cache', options);\n const storage = this.getStorage(options);\n const storageKey = options.storageKey || CACHE_STORAGE_NAME;\n return new SavedObject(storage, storageK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A,CAAA,CAAA,CAAA,CAAoB,CAAC,CAAO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAE,CAAO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAC,CAAC;CACtD,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,OAAO,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAC,CAAU,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAC,CAAO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAC,CAAC;AACzC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,UAAU,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,CAAC,CAAU,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,kBAAkB,CAAC;AAC5D,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,IAAI,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAC,OAAO,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAU,CAAC,CAAC;CAC7C,CAAA,CAAA,CAAA,CAAA;AAEF,CAAA;;"}
@@ -0,0 +1,21 @@
1
+ /*!
2
+ * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.
3
+ * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
4
+ *
5
+ * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
6
+ * Unless required by applicable law or agreed to in writing, software
7
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
8
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9
+ *
10
+ * See the License for the specific language governing permissions and limitations under the License.
11
+ */
12
+
13
+ import { JSONPath } from 'jsonpath-plus';
14
+
15
+ function jsonpath(options) {
16
+ return JSONPath(Object.assign({
17
+ preventEval: true }, options));
18
+ }
19
+
20
+ export { jsonpath };
21
+ //# sourceMappingURL=jsonpath.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jsonpath.js","sources":["../../../../lib/util/jsonpath.ts"],"sourcesContent":["import { JSONPath, JSONPathOptions } from 'jsonpath-plus';\n\nexport function jsonpath(options: JSONPathOptions): any {\n // eslint-disable-next-line new-cap\n return JSONPath({\n // Disable javascript evaluation by default\n\tpreventEval: true, ...options, });\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAEM,CAAU,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAwB,CAAA,CAAA,CAAA;AAE/C,CAAA,CAAA,CAAA,CAAA,OAAO,CAAQ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,MAAA,CAAA,CAAA;AAEhB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAW,EAAE,CAAI,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAI,CAAC;AACnC,CAAA;;"}
package/package.json CHANGED
@@ -2,12 +2,13 @@
2
2
  "private": false,
3
3
  "name": "@okta/okta-auth-js",
4
4
  "description": "The Okta Auth SDK",
5
- "version": "7.1.1",
5
+ "version": "7.3.0",
6
6
  "homepage": "https://github.com/okta/okta-auth-js",
7
7
  "license": "Apache-2.0",
8
8
  "main": "cjs/exports/default.js",
9
9
  "module": "esm/node/exports/exports/default.js",
10
10
  "browser": "umd/default.js",
11
+ "react-native": "esm/browser/exports/exports/default.js",
11
12
  "types": "types/lib/exports/default.d.ts",
12
13
  "exports": {
13
14
  ".": {
@@ -183,7 +184,7 @@
183
184
  "@typescript-eslint/eslint-plugin": "^5.18.0",
184
185
  "@typescript-eslint/parser": "^5.18.0",
185
186
  "babel-jest": "^27.5.1",
186
- "babel-loader": "^8.2.2",
187
+ "babel-loader": "^9.1.2",
187
188
  "babel-plugin-add-module-exports": "^1.0.2",
188
189
  "babel-plugin-inline-replace-variables": "^1.3.1",
189
190
  "chalk": "2.4.2",
@@ -215,8 +216,8 @@
215
216
  "shelljs": "0.8.5",
216
217
  "ts-jest": "^28.0.2",
217
218
  "tsd": "^0.17.0",
218
- "typedoc": "^0.22.13",
219
- "typedoc-plugin-markdown": "^3.11.14",
219
+ "typedoc": "^0.23.19",
220
+ "typedoc-plugin-markdown": "^3.13.6",
220
221
  "typescript": "^4.7.3",
221
222
  "webpack": "^5.60.0",
222
223
  "webpack-bundle-analyzer": "^4.5.0",
@@ -228,13 +229,14 @@
228
229
  "outputName": "junit-result.xml"
229
230
  },
230
231
  "resolutions": {
231
- "**/request/qs": "^6.10.5"
232
+ "**/request/qs": "^6.10.5",
233
+ "**/globule/minimatch": "^3.1.2"
232
234
  },
233
235
  "tsd": {
234
236
  "directory": "test/types"
235
237
  },
236
238
  "okta": {
237
- "commitSha": "75c5d434ac7f59d64575a88b84e4682a9ca9eeb1",
238
- "fullVersion": "7.1.1-g75c5d43"
239
+ "commitSha": "940dc7aa45494f7b399467d4fa48a058c65e0d37",
240
+ "fullVersion": "7.3.0-g940dc7a"
239
241
  }
240
242
  }
@@ -12,4 +12,5 @@ export interface OktaAuthCoreInterface<M extends PKCETransactionMeta = PKCETrans
12
12
  start(): Promise<void>;
13
13
  stop(): Promise<void>;
14
14
  handleLoginRedirect(tokens?: Tokens, originalUri?: string): Promise<void>;
15
+ handleRedirect(originalUri?: string): Promise<void>;
15
16
  }
@@ -1,7 +1,7 @@
1
1
  import { OktaAuthIdxOptions } from '../idx';
2
2
  export interface OktaAuthOptions extends OktaAuthIdxOptions {
3
3
  }
4
- declare const WithAuthn: import("./common").OktaAuthConstructor<import("../idx").OktaAuthIdxInterface<import("../idx").IdxTransactionMeta, import("../idx").IdxStorageManagerInterface<import("../idx").IdxTransactionMeta>, OktaAuthOptions, import("../idx").IdxTransactionManagerInterface> & import("./common").OktaAuthCoreInterface<import("../idx").IdxTransactionMeta, import("../idx").IdxStorageManagerInterface<import("../idx").IdxTransactionMeta>, OktaAuthOptions, import("../idx").IdxTransactionManagerInterface>> & import("./common").OktaAuthConstructor<import("../myaccount").OktaAuthMyAccountInterface<import("./common").PKCETransactionMeta, import("./common").OAuthStorageManagerInterface<import("./common").PKCETransactionMeta>, import("./common").OktaAuthOAuthOptions>> & import("./common").OktaAuthConstructor<import("../authn").OktaAuthTxInterface<import("./common").StorageManagerInterface, import("./common").OktaAuthHttpOptions>>;
4
+ declare const WithAuthn: import("../idx").OktaAuthIdxConstructor<import("../idx").OktaAuthIdxInterface<import("../idx").IdxTransactionMeta, import("../idx").IdxStorageManagerInterface<import("../idx").IdxTransactionMeta>, OktaAuthOptions, import("../idx").IdxTransactionManagerInterface> & import("./common").OktaAuthCoreInterface<import("../idx").IdxTransactionMeta, import("../idx").IdxStorageManagerInterface<import("../idx").IdxTransactionMeta>, OktaAuthOptions, import("../idx").IdxTransactionManagerInterface>> & import("./common").OktaAuthConstructor<import("../myaccount").OktaAuthMyAccountInterface<import("./common").PKCETransactionMeta, import("./common").OAuthStorageManagerInterface<import("./common").PKCETransactionMeta>, import("./common").OktaAuthOAuthOptions>> & import("./common").OktaAuthConstructor<import("../authn").OktaAuthTxInterface<import("./common").StorageManagerInterface, import("./common").OktaAuthHttpOptions>>;
5
5
  declare class OktaAuth extends WithAuthn {
6
6
  constructor(options: OktaAuthOptions);
7
7
  }
@@ -1,5 +1,5 @@
1
1
  import { OktaAuthIdxOptions } from '../idx';
2
- declare const OktaAuthIdx: import("./common").OktaAuthConstructor<import("../idx").OktaAuthIdxInterface<import("../idx").IdxTransactionMeta, import("../idx").IdxStorageManagerInterface<import("../idx").IdxTransactionMeta>, OktaAuthIdxOptions, import("../idx").IdxTransactionManagerInterface> & import("./common").OktaAuthCoreInterface<import("../idx").IdxTransactionMeta, import("../idx").IdxStorageManagerInterface<import("../idx").IdxTransactionMeta>, OktaAuthIdxOptions, import("../idx").IdxTransactionManagerInterface>>;
2
+ declare const OktaAuthIdx: import("../idx").OktaAuthIdxConstructor<import("../idx").OktaAuthIdxInterface<import("../idx").IdxTransactionMeta, import("../idx").IdxStorageManagerInterface<import("../idx").IdxTransactionMeta>, OktaAuthIdxOptions, import("../idx").IdxTransactionManagerInterface> & import("./common").OktaAuthCoreInterface<import("../idx").IdxTransactionMeta, import("../idx").IdxStorageManagerInterface<import("../idx").IdxTransactionMeta>, OktaAuthIdxOptions, import("../idx").IdxTransactionManagerInterface>>;
3
3
  export interface OktaAuthOptions extends OktaAuthIdxOptions {
4
4
  }
5
5
  declare class OktaAuth extends OktaAuthIdx {
@@ -1,9 +1,9 @@
1
- import { OktaAuthConstructor, OktaAuthOptionsConstructor } from '../../base/types';
1
+ import { OktaAuthOptionsConstructor } from '../../base/types';
2
2
  import { StorageManagerConstructor } from '../../storage/types';
3
- import { IdxTransactionManagerInterface, OktaAuthIdxInterface } from '../types/api';
3
+ import { IdxTransactionManagerInterface, OktaAuthIdxInterface, OktaAuthIdxConstructor } from '../types/api';
4
4
  import { IdxTransactionMeta } from '../types/meta';
5
5
  import { IdxStorageManagerInterface } from '../types/storage';
6
6
  import { OktaAuthIdxOptions } from '../types/options';
7
7
  import { TransactionManagerConstructor } from '../../oidc/types';
8
8
  import { OktaAuthCoreInterface } from '../../core/types';
9
- export declare function createOktaAuthIdx<M extends IdxTransactionMeta = IdxTransactionMeta, S extends IdxStorageManagerInterface<M> = IdxStorageManagerInterface<M>, O extends OktaAuthIdxOptions = OktaAuthIdxOptions, TM extends IdxTransactionManagerInterface = IdxTransactionManagerInterface>(StorageManagerConstructor: StorageManagerConstructor<S>, OptionsConstructor: OktaAuthOptionsConstructor<O>, TransactionManagerConstructor: TransactionManagerConstructor<TM>): OktaAuthConstructor<OktaAuthIdxInterface<M, S, O, TM> & OktaAuthCoreInterface<M, S, O, TM>>;
9
+ export declare function createOktaAuthIdx<M extends IdxTransactionMeta = IdxTransactionMeta, S extends IdxStorageManagerInterface<M> = IdxStorageManagerInterface<M>, O extends OktaAuthIdxOptions = OktaAuthIdxOptions, TM extends IdxTransactionManagerInterface = IdxTransactionManagerInterface>(StorageManagerConstructor: StorageManagerConstructor<S>, OptionsConstructor: OktaAuthOptionsConstructor<O>, TransactionManagerConstructor: TransactionManagerConstructor<TM>): OktaAuthIdxConstructor<OktaAuthIdxInterface<M, S, O, TM> & OktaAuthCoreInterface<M, S, O, TM>>;
@@ -1,6 +1,6 @@
1
1
  import { OktaAuthConstructor } from '../base/types';
2
2
  import { OktaAuthOAuthInterface } from '../oidc/types';
3
- import { IdxTransactionManagerInterface, OktaAuthIdxInterface, OktaAuthIdxOptions } from './types';
3
+ import { IdxTransactionManagerInterface, OktaAuthIdxInterface, OktaAuthIdxConstructor, OktaAuthIdxOptions } from './types';
4
4
  import { IdxTransactionMeta } from './types/meta';
5
5
  import { IdxStorageManagerInterface } from './types/storage';
6
- export declare function mixinIdx<M extends IdxTransactionMeta = IdxTransactionMeta, S extends IdxStorageManagerInterface<M> = IdxStorageManagerInterface<M>, O extends OktaAuthIdxOptions = OktaAuthIdxOptions, TM extends IdxTransactionManagerInterface = IdxTransactionManagerInterface, TBase extends OktaAuthConstructor<OktaAuthOAuthInterface<M, S, O, TM>> = OktaAuthConstructor<OktaAuthOAuthInterface<M, S, O, TM>>>(Base: TBase): TBase & OktaAuthConstructor<OktaAuthIdxInterface<M, S, O, TM>>;
6
+ export declare function mixinIdx<M extends IdxTransactionMeta = IdxTransactionMeta, S extends IdxStorageManagerInterface<M> = IdxStorageManagerInterface<M>, O extends OktaAuthIdxOptions = OktaAuthIdxOptions, TM extends IdxTransactionManagerInterface = IdxTransactionManagerInterface, TBase extends OktaAuthConstructor<OktaAuthOAuthInterface<M, S, O, TM>> = OktaAuthConstructor<OktaAuthOAuthInterface<M, S, O, TM>>>(Base: TBase): TBase & OktaAuthIdxConstructor<OktaAuthIdxInterface<M, S, O, TM>>;
@@ -12,10 +12,12 @@
12
12
  import { APIError } from '../../errors/types';
13
13
  import { OktaAuthOAuthInterface, Tokens, TransactionManagerConstructor, TransactionManagerInterface } from '../../oidc/types';
14
14
  import { FlowIdentifier } from './FlowIdentifier';
15
- import { IdxActions, IdxAuthenticator, IdxContext, IdxForm, IdxMessage, IdxOption, IdxRemediation, IdxResponse, RawIdxResponse, IdxActionParams, IdpConfig, IdxToPersist } from './idx-js';
15
+ import { IdxActions, IdxAuthenticator, IdxContext, IdxForm, IdxMessage, IdxOption, IdxRemediation, IdxResponse, RawIdxResponse, IdxActionParams, IdpConfig, IdxToPersist, ChallengeData, ActivationData } from './idx-js';
16
16
  import { AccountUnlockOptions, AuthenticationOptions, CancelOptions, InteractOptions, IntrospectOptions, OktaAuthIdxOptions, PasswordRecoveryOptions, ProceedOptions, RegistrationOptions, StartOptions, IdxTransactionMetaOptions } from './options';
17
17
  import { IdxTransactionMeta } from './meta';
18
18
  import { IdxStorageManagerInterface, SavedIdxResponse } from './storage';
19
+ import type { WebauthnEnrollValues, WebauthnVerificationValues } from '../authenticator';
20
+ import { OktaAuthConstructor } from '../../base/types';
19
21
  export declare enum IdxStatus {
20
22
  SUCCESS = "SUCCESS",
21
23
  PENDING = "PENDING",
@@ -153,6 +155,16 @@ export interface IdxTransactionManagerInterface extends TransactionManagerInterf
153
155
  clearIdxResponse(): void;
154
156
  }
155
157
  export declare type IdxTransactionManagerConstructor = TransactionManagerConstructor<IdxTransactionManagerInterface>;
158
+ export interface WebauthnAPI {
159
+ getAssertion(credential: PublicKeyCredential): WebauthnVerificationValues;
160
+ getAttestation(credential: PublicKeyCredential): WebauthnEnrollValues;
161
+ buildCredentialRequestOptions(challengeData: ChallengeData, authenticatorEnrollments: IdxAuthenticator[]): CredentialRequestOptions;
162
+ buildCredentialCreationOptions(activationData: ActivationData, authenticatorEnrollments: IdxAuthenticator[]): CredentialCreationOptions;
163
+ }
156
164
  export interface OktaAuthIdxInterface<M extends IdxTransactionMeta = IdxTransactionMeta, S extends IdxStorageManagerInterface<M> = IdxStorageManagerInterface<M>, O extends OktaAuthIdxOptions = OktaAuthIdxOptions, TM extends IdxTransactionManagerInterface = IdxTransactionManagerInterface> extends OktaAuthOAuthInterface<M, S, O, TM> {
157
165
  idx: IdxAPI;
158
166
  }
167
+ export interface OktaAuthIdxConstructor<I extends OktaAuthIdxInterface = OktaAuthIdxInterface> extends OktaAuthConstructor<I> {
168
+ new (...args: any[]): I;
169
+ webauthn: WebauthnAPI;
170
+ }
@@ -9,13 +9,7 @@
9
9
  *
10
10
  * See the License for the specific language governing permissions and limitations under the License.
11
11
  */
12
- import { ActivationData, ChallengeData, IdxAuthenticator, WebauthnEnrollValues, WebauthnVerificationValues } from './types';
13
- export interface WebauthnAPI {
14
- getAssertion(credential: PublicKeyCredential): WebauthnVerificationValues;
15
- getAttestation(credential: PublicKeyCredential): WebauthnEnrollValues;
16
- buildCredentialRequestOptions(challengeData: ChallengeData, authenticatorEnrollments: IdxAuthenticator[]): CredentialRequestOptions;
17
- buildCredentialCreationOptions(activationData: ActivationData, authenticatorEnrollments: IdxAuthenticator[]): CredentialCreationOptions;
18
- }
12
+ import { ActivationData, ChallengeData, IdxAuthenticator } from './types';
19
13
  export declare const buildCredentialCreationOptions: (activationData: ActivationData, authenticatorEnrollments: IdxAuthenticator[]) => CredentialCreationOptions;
20
14
  export declare const buildCredentialRequestOptions: (challengeData: ChallengeData, authenticatorEnrollments: IdxAuthenticator[]) => CredentialRequestOptions;
21
15
  export declare const getAttestation: (credential: PublicKeyCredential) => {
@@ -12,3 +12,4 @@
12
12
  export * from './profileApi';
13
13
  export * from './emailApi';
14
14
  export * from './phoneApi';
15
+ export * from './passwordApi';
@@ -1,29 +1,29 @@
1
1
  import { IAPIFunction, BaseTransaction, EmailTransaction, EmailChallengeTransaction } from './types';
2
2
  /**
3
- * @scope: okta.myaccount.email.read
3
+ * @scope: okta.myAccount.email.read
4
4
  */
5
5
  export declare const getEmails: IAPIFunction<EmailTransaction[]>;
6
6
  /**
7
- * @scope: okta.myaccount.email.read
7
+ * @scope: okta.myAccount.email.read
8
8
  */
9
9
  export declare const getEmail: IAPIFunction<EmailTransaction>;
10
10
  /**
11
- * @scope: okta.myaccount.email.manage
11
+ * @scope: okta.myAccount.email.manage
12
12
  */
13
13
  export declare const addEmail: IAPIFunction<EmailTransaction>;
14
14
  /**
15
- * @scope: okta.myaccount.email.manage
15
+ * @scope: okta.myAccount.email.manage
16
16
  */
17
17
  export declare const deleteEmail: IAPIFunction<BaseTransaction>;
18
18
  /**
19
- * @scope: okta.myaccount.email.read
19
+ * @scope: okta.myAccount.email.read
20
20
  */
21
21
  export declare const sendEmailChallenge: IAPIFunction<EmailChallengeTransaction>;
22
22
  /**
23
- * @scope: okta.myaccount.email.read
23
+ * @scope: okta.myAccount.email.read
24
24
  */
25
25
  export declare const getEmailChallenge: IAPIFunction<EmailChallengeTransaction>;
26
26
  /**
27
- * @scope: okta.myaccount.email.manage
27
+ * @scope: okta.myAccount.email.manage
28
28
  */
29
29
  export declare const verifyEmailChallenge: IAPIFunction<BaseTransaction>;
@@ -0,0 +1,17 @@
1
+ import { IAPIFunction, BaseTransaction, PasswordTransaction } from './types';
2
+ /**
3
+ * @scope: okta.myAccount.password.read
4
+ */
5
+ export declare const getPassword: IAPIFunction<PasswordTransaction>;
6
+ /**
7
+ * @scope: okta.myAccount.password.manage
8
+ */
9
+ export declare const enrollPassword: IAPIFunction<PasswordTransaction>;
10
+ /**
11
+ * @scope: okta.myAccount.password.manage
12
+ */
13
+ export declare const updatePassword: IAPIFunction<PasswordTransaction>;
14
+ /**
15
+ * @scope: okta.myAccount.password.manage
16
+ */
17
+ export declare const deletePassword: IAPIFunction<BaseTransaction>;
@@ -1,25 +1,25 @@
1
1
  import { IAPIFunction, BaseTransaction, PhoneTransaction } from './types';
2
2
  /**
3
- * @scope: okta.myaccount.phone.read
3
+ * @scope: okta.myAccount.phone.read
4
4
  */
5
5
  export declare const getPhones: IAPIFunction<PhoneTransaction[]>;
6
6
  /**
7
- * @scope: okta.myaccount.phone.read
7
+ * @scope: okta.myAccount.phone.read
8
8
  */
9
9
  export declare const getPhone: IAPIFunction<PhoneTransaction>;
10
10
  /**
11
- * @scope: okta.myaccount.phone.manage
11
+ * @scope: okta.myAccount.phone.manage
12
12
  */
13
13
  export declare const addPhone: IAPIFunction<PhoneTransaction>;
14
14
  /**
15
- * @scope: okta.myaccount.phone.manage
15
+ * @scope: okta.myAccount.phone.manage
16
16
  */
17
17
  export declare const deletePhone: IAPIFunction<BaseTransaction>;
18
18
  /**
19
- * @scope: okta.myaccount.phone.manage
19
+ * @scope: okta.myAccount.phone.manage
20
20
  */
21
21
  export declare const sendPhoneChallenge: IAPIFunction<BaseTransaction>;
22
22
  /**
23
- * @scope: okta.myaccount.phone.manage
23
+ * @scope: okta.myAccount.phone.manage
24
24
  */
25
25
  export declare const verifyPhoneChallenge: IAPIFunction<BaseTransaction>;
@@ -1,13 +1,13 @@
1
1
  import { IAPIFunction, ProfileTransaction, ProfileSchemaTransaction } from './types';
2
2
  /**
3
- * @scope: okta.myaccount.profile.read
3
+ * @scope: okta.myAccount.profile.read
4
4
  */
5
5
  export declare const getProfile: IAPIFunction<ProfileTransaction>;
6
6
  /**
7
- * @scope: okta.myaccount.profile.manage
7
+ * @scope: okta.myAccount.profile.manage
8
8
  */
9
9
  export declare const updateProfile: IAPIFunction<ProfileTransaction>;
10
10
  /**
11
- * @scope: okta.myaccount.profile.read
11
+ * @scope: okta.myAccount.profile.read
12
12
  */
13
13
  export declare const getProfileSchema: IAPIFunction<ProfileSchemaTransaction>;
@@ -0,0 +1,13 @@
1
+ import { EnrollPasswordPayload, UpdatePasswordPayload, PasswordStatus } from '../types';
2
+ import BaseTransaction from './Base';
3
+ export default class PasswordTransaction extends BaseTransaction {
4
+ id: string;
5
+ created: string;
6
+ lastUpdated: string;
7
+ status: PasswordStatus;
8
+ get?: () => Promise<PasswordTransaction>;
9
+ enroll?: (payload: EnrollPasswordPayload) => Promise<PasswordTransaction>;
10
+ update?: (payload: UpdatePasswordPayload) => Promise<PasswordTransaction>;
11
+ delete?: () => Promise<BaseTransaction>;
12
+ constructor(oktaAuth: any, options: any);
13
+ }
@@ -4,4 +4,5 @@ export { default as EmailTransaction } from './EmailTransaction';
4
4
  export { default as EmailStatusTransaction } from './EmailStatusTransaction';
5
5
  export { default as EmailChallengeTransaction } from './EmailChallengeTransaction';
6
6
  export { default as PhoneTransaction } from './PhoneTransaction';
7
+ export { default as PasswordTransaction } from './PasswordTransaction';
7
8
  export { default as BaseTransaction } from './Base';
@@ -1,5 +1,5 @@
1
1
  import { OAuthStorageManagerInterface, OAuthTransactionMeta, OktaAuthOAuthInterface, OktaAuthOAuthOptions, PKCETransactionMeta } from '../oidc/types';
2
- export { EmailTransaction, EmailStatusTransaction, EmailChallengeTransaction, PhoneTransaction, ProfileTransaction, ProfileSchemaTransaction, BaseTransaction } from './transactions';
2
+ export { EmailTransaction, EmailStatusTransaction, EmailChallengeTransaction, PhoneTransaction, ProfileTransaction, ProfileSchemaTransaction, PasswordTransaction, BaseTransaction } from './transactions';
3
3
  export declare enum EmailRole {
4
4
  PRIMARY = "PRIMARY",
5
5
  SECONDARY = "SECONDARY"
@@ -8,6 +8,10 @@ export declare enum Status {
8
8
  VERIFIED = "VERIFIED",
9
9
  UNVERIFIED = "UNVERIFIED"
10
10
  }
11
+ export declare enum PasswordStatus {
12
+ NOT_ENROLLED = "NOT_ENROLLED",
13
+ ACTIVE = "ACTIVE"
14
+ }
11
15
  export declare type EmailProfile = {
12
16
  email: string;
13
17
  };
@@ -36,6 +40,17 @@ export declare type ChallengePhonePayload = {
36
40
  export declare type VerificationPayload = {
37
41
  verificationCode: string;
38
42
  };
43
+ export declare type EnrollPasswordPayload = {
44
+ profile: {
45
+ password: string;
46
+ };
47
+ };
48
+ export declare type UpdatePasswordPayload = {
49
+ profile: {
50
+ password: string;
51
+ currentPassword?: string;
52
+ };
53
+ };
39
54
  export declare type UpdateProfilePayload = {
40
55
  profile: {
41
56
  firstName?: string;
@@ -49,7 +64,7 @@ export declare type MyAccountRequestOptions = {
49
64
  id?: string;
50
65
  emailId?: string;
51
66
  challengeId?: string;
52
- payload?: AddEmailPayload | AddPhonePayload | ChallengePhonePayload | VerificationPayload | UpdateProfilePayload;
67
+ payload?: AddEmailPayload | AddPhonePayload | ChallengePhonePayload | VerificationPayload | UpdateProfilePayload | EnrollPasswordPayload | UpdatePasswordPayload;
53
68
  accessToken?: string;
54
69
  };
55
70
  export declare type IAPIFunction<T> = (oktaAuth: OktaAuthOAuthInterface, options?: MyAccountRequestOptions) => Promise<T>;
@@ -18,6 +18,7 @@ export declare class TokenManager implements TokenManagerInterface {
18
18
  constructor(sdk: OktaAuthOAuthInterface, options?: TokenManagerOptions);
19
19
  start(): void;
20
20
  stop(): void;
21
+ isStarted(): boolean;
21
22
  getOptions(): TokenManagerOptions;
22
23
  getExpireTime(token: any): number;
23
24
  hasExpired(token: any): boolean;
@@ -0,0 +1,14 @@
1
+ /*!
2
+ * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.
3
+ * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
4
+ *
5
+ * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
6
+ * Unless required by applicable law or agreed to in writing, software
7
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
8
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9
+ *
10
+ * See the License for the specific language governing permissions and limitations under the License.
11
+ *
12
+ */
13
+ import { OktaAuthOAuthInterface, EnrollAuthenticatorOptions } from './types';
14
+ export declare function enrollAuthenticator(sdk: OktaAuthOAuthInterface, options: EnrollAuthenticatorOptions): void;
@@ -11,5 +11,6 @@
11
11
  *
12
12
  */
13
13
  import { PromiseQueue } from '../../util';
14
- import { OktaAuthOAuthInterface, TokenAPI } from '../types';
14
+ import { OktaAuthOAuthInterface, TokenAPI, Endpoints } from '../types';
15
15
  export declare function createTokenAPI(sdk: OktaAuthOAuthInterface, queue: PromiseQueue): TokenAPI;
16
+ export declare function createEndpoints(sdk: OktaAuthOAuthInterface): Endpoints;
@@ -58,4 +58,5 @@ export interface TokenManagerInterface {
58
58
  getStorage(): StorageProvider;
59
59
  start(): any;
60
60
  stop(): any;
61
+ isStarted(): boolean;
61
62
  }
@@ -12,12 +12,14 @@
12
12
  import { JWTObject } from './JWT';
13
13
  import { OAuthTransactionMeta, PKCETransactionMeta } from './meta';
14
14
  import { CustomUrls, OktaAuthOAuthOptions, SigninWithRedirectOptions, TokenParams } from './options';
15
+ import { OAuthResponseType } from './proto';
15
16
  import { OAuthStorageManagerInterface } from './storage';
16
17
  import { AccessToken, IDToken, RefreshToken, RevocableToken, Token, Tokens } from './Token';
17
18
  import { TokenManagerInterface } from './TokenManager';
18
19
  import { CustomUserClaims, UserClaims } from './UserClaims';
19
20
  import { TransactionManagerInterface } from './TransactionManager';
20
21
  import { OktaAuthSessionInterface } from '../../session/types';
22
+ import { Endpoints } from './endpoints';
21
23
  export interface PopupParams {
22
24
  popupTitle?: string;
23
25
  popupWindow?: Window;
@@ -26,6 +28,7 @@ export interface TokenResponse {
26
28
  tokens: Tokens;
27
29
  state: string;
28
30
  code?: string;
31
+ responseType?: OAuthResponseType | OAuthResponseType[] | 'none';
29
32
  }
30
33
  export interface ParseFromUrlOptions {
31
34
  url?: string;
@@ -39,9 +42,6 @@ export interface ParseFromUrlInterface extends ParseFromUrlFunction {
39
42
  }
40
43
  export declare type GetWithRedirectFunction = (params?: TokenParams) => Promise<void>;
41
44
  export declare type SetLocationFunction = (loc: string) => void;
42
- export interface GetWithRedirectAPI extends GetWithRedirectFunction {
43
- _setLocation: SetLocationFunction;
44
- }
45
45
  export interface BaseTokenAPI {
46
46
  decode(token: string): JWTObject;
47
47
  prepareTokenParams(params?: TokenParams): Promise<TokenParams>;
@@ -49,7 +49,7 @@ export interface BaseTokenAPI {
49
49
  }
50
50
  export interface TokenAPI extends BaseTokenAPI {
51
51
  getUserInfo<S extends CustomUserClaims = CustomUserClaims>(accessToken?: AccessToken, idToken?: IDToken): Promise<UserClaims<S>>;
52
- getWithRedirect: GetWithRedirectAPI;
52
+ getWithRedirect: GetWithRedirectFunction;
53
53
  parseFromUrl: ParseFromUrlInterface;
54
54
  getWithoutPrompt(params?: TokenParams): Promise<TokenResponse>;
55
55
  getWithPopup(params?: TokenParams): Promise<TokenResponse>;
@@ -103,12 +103,13 @@ export interface OktaAuthOAuthInterface<M extends OAuthTransactionMeta = PKCETra
103
103
  tokenManager: TokenManagerInterface;
104
104
  pkce: PkceAPI;
105
105
  transactionManager: TM;
106
+ endpoints: Endpoints;
106
107
  isPKCE(): boolean;
107
108
  getIdToken(): string | undefined;
108
109
  getAccessToken(): string | undefined;
109
110
  getRefreshToken(): string | undefined;
110
111
  isAuthenticated(options?: IsAuthenticatedOptions): Promise<boolean>;
111
- signOut(opts?: SignoutOptions): Promise<void>;
112
+ signOut(opts?: SignoutOptions): Promise<boolean>;
112
113
  isLoginRedirect(): boolean;
113
114
  storeTokensFromRedirect(): Promise<void>;
114
115
  getUser<T extends CustomUserClaims = CustomUserClaims>(): Promise<UserClaims<T>>;
@@ -0,0 +1,18 @@
1
+ /*!
2
+ * Copyright (c) 2021-present, Okta, Inc. and/or its affiliates. All rights reserved.
3
+ * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
4
+ *
5
+ * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
6
+ * Unless required by applicable law or agreed to in writing, software
7
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
8
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9
+ *
10
+ * See the License for the specific language governing permissions and limitations under the License.
11
+ */
12
+ import { EnrollAuthenticatorOptions } from './options';
13
+ export declare type EnrollAuthenticatorFunction = (params: EnrollAuthenticatorOptions) => void;
14
+ export interface Endpoints {
15
+ authorize: {
16
+ enrollAuthenticator: EnrollAuthenticatorFunction;
17
+ };
18
+ }
@@ -20,3 +20,4 @@ export * from './TokenManager';
20
20
  export * from './Transaction';
21
21
  export * from './TransactionManager';
22
22
  export * from './UserClaims';
23
+ export * from './endpoints';
@@ -10,7 +10,7 @@
10
10
  * See the License for the specific language governing permissions and limitations under the License.
11
11
  */
12
12
  import { CustomUrls, TokenParams } from './options';
13
- export interface OAuthTransactionMeta extends Pick<TokenParams, 'issuer' | 'clientId' | 'redirectUri' | 'responseType' | 'responseMode' | 'scopes' | 'state' | 'pkce' | 'ignoreSignature' | 'nonce' | 'acrValues'> {
13
+ export interface OAuthTransactionMeta extends Pick<TokenParams, 'issuer' | 'clientId' | 'redirectUri' | 'responseType' | 'responseMode' | 'scopes' | 'state' | 'pkce' | 'ignoreSignature' | 'nonce' | 'acrValues' | 'enrollAmrValues'> {
14
14
  urls: CustomUrls;
15
15
  originalUri?: string;
16
16
  }