@okta/okta-auth-js 7.1.0 → 7.2.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.
- package/CHANGELOG.md +36 -0
- package/README.md +93 -36
- package/cjs/core/mixin.js +3 -0
- package/cjs/core/mixin.js.map +1 -1
- package/cjs/core/types/api.js.map +1 -1
- package/cjs/http/OktaUserAgent.js +2 -2
- package/cjs/idx/IdxTransactionManager.js +0 -4
- package/cjs/idx/IdxTransactionManager.js.map +1 -1
- package/cjs/idx/factory/OktaAuthIdx.js.map +1 -1
- package/cjs/idx/idxState/v1/idxResponseParser.js +2 -3
- package/cjs/idx/idxState/v1/idxResponseParser.js.map +1 -1
- package/cjs/idx/mixin.js.map +1 -1
- package/cjs/idx/register.js +1 -7
- package/cjs/idx/register.js.map +1 -1
- package/cjs/idx/types/api.js.map +1 -1
- package/cjs/idx/types/idx-js.js.map +1 -1
- package/cjs/idx/types/index.js.map +1 -1
- package/cjs/idx/webauthn.js.map +1 -1
- package/cjs/myaccount/api.js +11 -0
- package/cjs/myaccount/api.js.map +1 -1
- package/cjs/myaccount/emailApi.js +7 -7
- package/cjs/myaccount/emailApi.js.map +1 -1
- package/cjs/myaccount/passwordApi.js +69 -0
- package/cjs/myaccount/passwordApi.js.map +1 -0
- package/cjs/myaccount/phoneApi.js +6 -6
- package/cjs/myaccount/phoneApi.js.map +1 -1
- package/cjs/myaccount/profileApi.js +3 -3
- package/cjs/myaccount/profileApi.js.map +1 -1
- package/cjs/myaccount/request.js +2 -1
- package/cjs/myaccount/request.js.map +1 -1
- package/cjs/myaccount/transactions/PasswordTransaction.js +81 -0
- package/cjs/myaccount/transactions/PasswordTransaction.js.map +1 -0
- package/cjs/myaccount/transactions/index.js +7 -0
- package/cjs/myaccount/transactions/index.js.map +1 -1
- package/cjs/myaccount/types.js +13 -0
- package/cjs/myaccount/types.js.map +1 -1
- package/cjs/oidc/TokenManager.js +5 -0
- package/cjs/oidc/TokenManager.js.map +1 -1
- package/cjs/oidc/endpoints/authorize.js +4 -3
- package/cjs/oidc/endpoints/authorize.js.map +1 -1
- package/cjs/oidc/enrollAuthenticator.js +33 -0
- package/cjs/oidc/enrollAuthenticator.js.map +1 -0
- package/cjs/oidc/factory/api.js +11 -11
- package/cjs/oidc/factory/api.js.map +1 -1
- package/cjs/oidc/getWithRedirect.js +5 -1
- package/cjs/oidc/getWithRedirect.js.map +1 -1
- package/cjs/oidc/handleOAuthResponse.js +3 -2
- package/cjs/oidc/handleOAuthResponse.js.map +1 -1
- package/cjs/oidc/mixin/index.js +6 -2
- package/cjs/oidc/mixin/index.js.map +1 -1
- package/cjs/oidc/types/TokenManager.js.map +1 -1
- package/cjs/oidc/types/api.js.map +1 -1
- package/cjs/oidc/types/endpoints.js +2 -0
- package/cjs/oidc/types/endpoints.js.map +1 -0
- package/cjs/oidc/types/index.js +11 -0
- package/cjs/oidc/types/index.js.map +1 -1
- package/cjs/oidc/types/meta.js.map +1 -1
- package/cjs/oidc/types/options.js.map +1 -1
- package/cjs/oidc/types/proto.js.map +1 -1
- package/cjs/oidc/util/defaultEnrollAuthenticatorParams.js +38 -0
- package/cjs/oidc/util/defaultEnrollAuthenticatorParams.js.map +1 -0
- package/cjs/oidc/util/enrollAuthenticatorMeta.js +23 -0
- package/cjs/oidc/util/enrollAuthenticatorMeta.js.map +1 -0
- package/cjs/oidc/util/index.js +36 -0
- package/cjs/oidc/util/index.js.map +1 -1
- package/cjs/oidc/util/prepareEnrollAuthenticatorParams.js +50 -0
- package/cjs/oidc/util/prepareEnrollAuthenticatorParams.js.map +1 -0
- package/cjs/services/AutoRenewService.js +15 -0
- package/cjs/services/AutoRenewService.js.map +1 -1
- package/cjs/util/jsonpath.js +13 -0
- package/cjs/util/jsonpath.js.map +1 -0
- package/dist/okta-auth-js.authn.min.analyzer.html +2 -2
- package/dist/okta-auth-js.authn.min.js +1 -1
- package/dist/okta-auth-js.authn.min.js.map +1 -1
- package/dist/okta-auth-js.core.min.analyzer.html +2 -2
- package/dist/okta-auth-js.core.min.js +1 -1
- package/dist/okta-auth-js.core.min.js.map +1 -1
- package/dist/okta-auth-js.idx.min.analyzer.html +2 -2
- package/dist/okta-auth-js.idx.min.js +1 -1
- package/dist/okta-auth-js.idx.min.js.map +1 -1
- package/dist/okta-auth-js.min.analyzer.html +2 -2
- package/dist/okta-auth-js.min.js +1 -1
- package/dist/okta-auth-js.min.js.map +1 -1
- package/dist/okta-auth-js.myaccount.min.analyzer.html +2 -2
- package/dist/okta-auth-js.myaccount.min.js +1 -1
- package/dist/okta-auth-js.myaccount.min.js.map +1 -1
- package/esm/browser/core/mixin.js +3 -0
- package/esm/browser/core/mixin.js.map +1 -1
- package/esm/browser/exports/exports/authn.js +4 -1
- package/esm/browser/exports/exports/authn.js.map +1 -1
- package/esm/browser/exports/exports/core.js +4 -1
- package/esm/browser/exports/exports/core.js.map +1 -1
- package/esm/browser/exports/exports/default.js +7 -2
- package/esm/browser/exports/exports/default.js.map +1 -1
- package/esm/browser/exports/exports/idx.js +4 -1
- package/esm/browser/exports/exports/idx.js.map +1 -1
- package/esm/browser/exports/exports/myaccount.js +7 -2
- package/esm/browser/exports/exports/myaccount.js.map +1 -1
- package/esm/browser/http/OktaUserAgent.js +2 -2
- package/esm/browser/idx/IdxTransactionManager.js +1 -4
- package/esm/browser/idx/IdxTransactionManager.js.map +1 -1
- package/esm/browser/idx/factory/OktaAuthIdx.js.map +1 -1
- package/esm/browser/idx/idxState/v1/idxResponseParser.js +2 -2
- package/esm/browser/idx/idxState/v1/idxResponseParser.js.map +1 -1
- package/esm/browser/idx/mixin.js.map +1 -1
- package/esm/browser/idx/register.js +1 -4
- package/esm/browser/idx/register.js.map +1 -1
- package/esm/browser/idx/types/api.js.map +1 -1
- package/esm/browser/idx/types/idx-js.js.map +1 -1
- package/esm/browser/idx/webauthn.js.map +1 -1
- package/esm/browser/myaccount/api.js +1 -0
- package/esm/browser/myaccount/api.js.map +1 -1
- package/esm/browser/myaccount/emailApi.js.map +1 -1
- package/esm/browser/myaccount/passwordApi.js +56 -0
- package/esm/browser/myaccount/passwordApi.js.map +1 -0
- package/esm/browser/myaccount/phoneApi.js.map +1 -1
- package/esm/browser/myaccount/profileApi.js.map +1 -1
- package/esm/browser/myaccount/request.js +3 -1
- package/esm/browser/myaccount/request.js.map +1 -1
- package/esm/browser/myaccount/transactions/PasswordTransaction.js +73 -0
- package/esm/browser/myaccount/transactions/PasswordTransaction.js.map +1 -0
- package/esm/browser/myaccount/types.js +6 -1
- package/esm/browser/myaccount/types.js.map +1 -1
- package/esm/browser/oidc/TokenManager.js +5 -0
- package/esm/browser/oidc/TokenManager.js.map +1 -1
- package/esm/browser/oidc/endpoints/authorize.js +3 -2
- package/esm/browser/oidc/endpoints/authorize.js.map +1 -1
- package/esm/browser/oidc/enrollAuthenticator.js +36 -0
- package/esm/browser/oidc/enrollAuthenticator.js.map +1 -0
- package/esm/browser/oidc/factory/api.js +10 -12
- package/esm/browser/oidc/factory/api.js.map +1 -1
- package/esm/browser/oidc/getWithRedirect.js +6 -1
- package/esm/browser/oidc/getWithRedirect.js.map +1 -1
- package/esm/browser/oidc/handleOAuthResponse.js +3 -2
- package/esm/browser/oidc/handleOAuthResponse.js.map +1 -1
- package/esm/browser/oidc/mixin/index.js +6 -3
- package/esm/browser/oidc/mixin/index.js.map +1 -1
- package/esm/browser/oidc/types/TokenManager.js.map +1 -1
- package/esm/browser/oidc/util/defaultEnrollAuthenticatorParams.js +31 -0
- package/esm/browser/oidc/util/defaultEnrollAuthenticatorParams.js.map +1 -0
- package/esm/browser/oidc/util/enrollAuthenticatorMeta.js +33 -0
- package/esm/browser/oidc/util/enrollAuthenticatorMeta.js.map +1 -0
- package/esm/browser/oidc/util/prepareEnrollAuthenticatorParams.js +34 -0
- package/esm/browser/oidc/util/prepareEnrollAuthenticatorParams.js.map +1 -0
- package/esm/browser/package.json +1 -1
- package/esm/browser/services/AutoRenewService.js +14 -0
- package/esm/browser/services/AutoRenewService.js.map +1 -1
- package/esm/browser/util/jsonpath.js +21 -0
- package/esm/browser/util/jsonpath.js.map +1 -0
- package/esm/node/core/mixin.js +3 -0
- package/esm/node/core/mixin.js.map +1 -1
- package/esm/node/exports/exports/authn.js +4 -1
- package/esm/node/exports/exports/authn.js.map +1 -1
- package/esm/node/exports/exports/core.js +4 -1
- package/esm/node/exports/exports/core.js.map +1 -1
- package/esm/node/exports/exports/default.js +7 -2
- package/esm/node/exports/exports/default.js.map +1 -1
- package/esm/node/exports/exports/idx.js +4 -1
- package/esm/node/exports/exports/idx.js.map +1 -1
- package/esm/node/exports/exports/myaccount.js +7 -2
- package/esm/node/exports/exports/myaccount.js.map +1 -1
- package/esm/node/http/OktaUserAgent.js +2 -2
- package/esm/node/idx/IdxTransactionManager.js +1 -4
- package/esm/node/idx/IdxTransactionManager.js.map +1 -1
- package/esm/node/idx/factory/OktaAuthIdx.js.map +1 -1
- package/esm/node/idx/idxState/v1/idxResponseParser.js +2 -2
- package/esm/node/idx/idxState/v1/idxResponseParser.js.map +1 -1
- package/esm/node/idx/mixin.js.map +1 -1
- package/esm/node/idx/register.js +1 -4
- package/esm/node/idx/register.js.map +1 -1
- package/esm/node/idx/types/api.js.map +1 -1
- package/esm/node/idx/types/idx-js.js.map +1 -1
- package/esm/node/idx/webauthn.js.map +1 -1
- package/esm/node/myaccount/api.js +1 -0
- package/esm/node/myaccount/api.js.map +1 -1
- package/esm/node/myaccount/emailApi.js.map +1 -1
- package/esm/node/myaccount/passwordApi.js +56 -0
- package/esm/node/myaccount/passwordApi.js.map +1 -0
- package/esm/node/myaccount/phoneApi.js.map +1 -1
- package/esm/node/myaccount/profileApi.js.map +1 -1
- package/esm/node/myaccount/request.js +3 -1
- package/esm/node/myaccount/request.js.map +1 -1
- package/esm/node/myaccount/transactions/PasswordTransaction.js +73 -0
- package/esm/node/myaccount/transactions/PasswordTransaction.js.map +1 -0
- package/esm/node/myaccount/types.js +6 -1
- package/esm/node/myaccount/types.js.map +1 -1
- package/esm/node/oidc/TokenManager.js +5 -0
- package/esm/node/oidc/TokenManager.js.map +1 -1
- package/esm/node/oidc/endpoints/authorize.js +3 -2
- package/esm/node/oidc/endpoints/authorize.js.map +1 -1
- package/esm/node/oidc/enrollAuthenticator.js +37 -0
- package/esm/node/oidc/enrollAuthenticator.js.map +1 -0
- package/esm/node/oidc/factory/api.js +10 -12
- package/esm/node/oidc/factory/api.js.map +1 -1
- package/esm/node/oidc/getWithRedirect.js +6 -1
- package/esm/node/oidc/getWithRedirect.js.map +1 -1
- package/esm/node/oidc/handleOAuthResponse.js +3 -2
- package/esm/node/oidc/handleOAuthResponse.js.map +1 -1
- package/esm/node/oidc/mixin/index.js +6 -3
- package/esm/node/oidc/mixin/index.js.map +1 -1
- package/esm/node/oidc/types/TokenManager.js.map +1 -1
- package/esm/node/oidc/util/defaultEnrollAuthenticatorParams.js +31 -0
- package/esm/node/oidc/util/defaultEnrollAuthenticatorParams.js.map +1 -0
- package/esm/node/oidc/util/enrollAuthenticatorMeta.js +33 -0
- package/esm/node/oidc/util/enrollAuthenticatorMeta.js.map +1 -0
- package/esm/node/oidc/util/prepareEnrollAuthenticatorParams.js +34 -0
- package/esm/node/oidc/util/prepareEnrollAuthenticatorParams.js.map +1 -0
- package/esm/node/package.json +1 -1
- package/esm/node/util/jsonpath.js +21 -0
- package/esm/node/util/jsonpath.js.map +1 -0
- package/package.json +5 -5
- package/types/lib/core/types/api.d.ts +1 -0
- package/types/lib/exports/default.d.ts +1 -1
- package/types/lib/exports/idx.d.ts +1 -1
- package/types/lib/idx/factory/OktaAuthIdx.d.ts +3 -3
- package/types/lib/idx/mixin.d.ts +2 -2
- package/types/lib/idx/types/api.d.ts +13 -1
- package/types/lib/idx/types/idx-js.d.ts +13 -0
- package/types/lib/idx/types/index.d.ts +1 -1
- package/types/lib/idx/webauthn.d.ts +1 -7
- package/types/lib/myaccount/api.d.ts +1 -0
- package/types/lib/myaccount/emailApi.d.ts +7 -7
- package/types/lib/myaccount/passwordApi.d.ts +17 -0
- package/types/lib/myaccount/phoneApi.d.ts +6 -6
- package/types/lib/myaccount/profileApi.d.ts +3 -3
- package/types/lib/myaccount/transactions/PasswordTransaction.d.ts +13 -0
- package/types/lib/myaccount/transactions/index.d.ts +1 -0
- package/types/lib/myaccount/types.d.ts +17 -2
- package/types/lib/oidc/TokenManager.d.ts +1 -0
- package/types/lib/oidc/enrollAuthenticator.d.ts +14 -0
- package/types/lib/oidc/factory/api.d.ts +2 -1
- package/types/lib/oidc/types/TokenManager.d.ts +1 -0
- package/types/lib/oidc/types/api.d.ts +5 -4
- package/types/lib/oidc/types/endpoints.d.ts +18 -0
- package/types/lib/oidc/types/index.d.ts +1 -0
- package/types/lib/oidc/types/meta.d.ts +1 -1
- package/types/lib/oidc/types/options.d.ts +6 -1
- package/types/lib/oidc/types/proto.d.ts +1 -0
- package/types/lib/oidc/util/defaultEnrollAuthenticatorParams.d.ts +2 -0
- package/types/lib/oidc/util/enrollAuthenticatorMeta.d.ts +2 -0
- package/types/lib/oidc/util/index.d.ts +3 -0
- package/types/lib/oidc/util/prepareEnrollAuthenticatorParams.d.ts +2 -0
- package/types/lib/services/AutoRenewService.d.ts +1 -0
- package/types/lib/util/jsonpath.d.ts +2 -0
- package/umd/authn.js +1 -1
- package/umd/authn.js.map +1 -1
- package/umd/core.js +1 -1
- package/umd/core.js.map +1 -1
- package/umd/default.js +1 -1
- package/umd/default.js.map +1 -1
- package/umd/idx.js +1 -1
- package/umd/idx.js.map +1 -1
- package/umd/myaccount.js +1 -1
- package/umd/myaccount.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TokenManager.js","names":["EVENT_EXPIRED","EVENT_RENEWED","EVENT_ADDED","EVENT_REMOVED","EVENT_ERROR","EVENT_SET_STORAGE"],"sources":["../../../../lib/oidc/types/TokenManager.ts"],"sourcesContent":["/* eslint-disable max-len */\nimport { StorageProvider } from '../../storage/types';\nimport { TokenManagerOptions } from './options';\nimport { AccessToken, IDToken, RefreshToken, Token, Tokens, TokenType } from './Token';\n\nexport interface TokenManagerError {\n errorSummary: string;\n errorCode: string;\n message: string;\n name: string;\n tokenKey: string;\n}\n\nexport declare type AccessTokenCallback = (key: string, token: AccessToken) => void;\nexport declare type IDTokenCallback = (key: string, token: IDToken) => void;\nexport declare type RefreshTokenCallback = (key: string, token: RefreshToken) => void;\n\nexport const EVENT_EXPIRED = 'expired';\nexport const EVENT_RENEWED = 'renewed';\nexport const EVENT_ADDED = 'added';\nexport const EVENT_REMOVED = 'removed';\nexport const EVENT_ERROR = 'error';\nexport const EVENT_SET_STORAGE = 'set_storage';\n\nexport declare type TokenManagerErrorEventHandler = (error: TokenManagerError) => void;\nexport declare type TokenManagerEventHandler = (key: string, token: Token) => void;\nexport declare type TokenManagerRenewEventHandler = (key: string, token: Token, oldtoken: Token) => void;\nexport declare type TokenManagerSetStorageEventHandler = (storage: Tokens) => void;\n\nexport declare type TokenManagerAnyEventHandler = TokenManagerErrorEventHandler | TokenManagerRenewEventHandler | TokenManagerSetStorageEventHandler | TokenManagerEventHandler;\nexport declare type TokenManagerAnyEvent = typeof EVENT_RENEWED | typeof EVENT_ERROR | typeof EVENT_SET_STORAGE | typeof EVENT_EXPIRED | typeof EVENT_ADDED | typeof EVENT_REMOVED;\n\n// only add methods needed internally\nexport interface TokenManagerInterface {\n on(event: typeof EVENT_RENEWED, handler: TokenManagerRenewEventHandler, context?: object): void;\n on(event: typeof EVENT_ERROR, handler: TokenManagerErrorEventHandler, context?: object): void;\n on(event: typeof EVENT_SET_STORAGE, handler: TokenManagerSetStorageEventHandler, context?: object): void;\n on(event: typeof EVENT_EXPIRED | typeof EVENT_ADDED | typeof EVENT_REMOVED, handler: TokenManagerEventHandler, context?: object): void;\n\n off(event: typeof EVENT_RENEWED, handler?: TokenManagerRenewEventHandler): void;\n off(event: typeof EVENT_ERROR, handler?: TokenManagerErrorEventHandler): void;\n off(event: typeof EVENT_SET_STORAGE, handler?: TokenManagerSetStorageEventHandler): void;\n off(event: typeof EVENT_EXPIRED | typeof EVENT_ADDED | typeof EVENT_REMOVED, handler?: TokenManagerEventHandler): void;\n\n clear(): void;\n setExpireEventTimeout(key: string, token: Token): void;\n clearExpireEventTimeout(key: string): void;\n clearExpireEventTimeoutAll(): void;\n emitAdded(key: string, token: Token): void;\n emitError(error: Error): void;\n emitRemoved(key: string, token: Token): void;\n emitRenewed(key: string, token: Token, oldToken?: Token): void;\n renew(key: string): Promise<Token | undefined>;\n remove(key: string): void;\n hasExpired(token: Token): boolean;\n getExpireTime(token: Token): number;\n\n get(key): Promise<Token>;\n getSync(key): Token;\n getTokens(): Promise<Tokens>;\n getTokensSync(): Tokens;\n setTokens({ accessToken, idToken, refreshToken }: Tokens, accessTokenCb?: AccessTokenCallback, idTokenCb?: IDTokenCallback, refreshTokenCb?: RefreshTokenCallback): void;\n getStorageKeyByType(type: TokenType): string;\n add(key: any, token: Token): void;\n updateRefreshToken(token: RefreshToken);\n removeRefreshToken(): void;\n clearPendingRemoveTokens(): void;\n\n getOptions(): TokenManagerOptions;\n getStorage(): StorageProvider;\n\n start();\n stop();\n}\n"],"mappings":";;;AAAA;;AAiBO,MAAMA,aAAa,GAAG,SAAS;AAAC;AAChC,MAAMC,aAAa,GAAG,SAAS;AAAC;AAChC,MAAMC,WAAW,GAAG,OAAO;AAAC;AAC5B,MAAMC,aAAa,GAAG,SAAS;AAAC;AAChC,MAAMC,WAAW,GAAG,OAAO;AAAC;AAC5B,MAAMC,iBAAiB,GAAG,aAAa;AAAC"}
|
|
1
|
+
{"version":3,"file":"TokenManager.js","names":["EVENT_EXPIRED","EVENT_RENEWED","EVENT_ADDED","EVENT_REMOVED","EVENT_ERROR","EVENT_SET_STORAGE"],"sources":["../../../../lib/oidc/types/TokenManager.ts"],"sourcesContent":["/* eslint-disable max-len */\nimport { StorageProvider } from '../../storage/types';\nimport { TokenManagerOptions } from './options';\nimport { AccessToken, IDToken, RefreshToken, Token, Tokens, TokenType } from './Token';\n\nexport interface TokenManagerError {\n errorSummary: string;\n errorCode: string;\n message: string;\n name: string;\n tokenKey: string;\n}\n\nexport declare type AccessTokenCallback = (key: string, token: AccessToken) => void;\nexport declare type IDTokenCallback = (key: string, token: IDToken) => void;\nexport declare type RefreshTokenCallback = (key: string, token: RefreshToken) => void;\n\nexport const EVENT_EXPIRED = 'expired';\nexport const EVENT_RENEWED = 'renewed';\nexport const EVENT_ADDED = 'added';\nexport const EVENT_REMOVED = 'removed';\nexport const EVENT_ERROR = 'error';\nexport const EVENT_SET_STORAGE = 'set_storage';\n\nexport declare type TokenManagerErrorEventHandler = (error: TokenManagerError) => void;\nexport declare type TokenManagerEventHandler = (key: string, token: Token) => void;\nexport declare type TokenManagerRenewEventHandler = (key: string, token: Token, oldtoken: Token) => void;\nexport declare type TokenManagerSetStorageEventHandler = (storage: Tokens) => void;\n\nexport declare type TokenManagerAnyEventHandler = TokenManagerErrorEventHandler | TokenManagerRenewEventHandler | TokenManagerSetStorageEventHandler | TokenManagerEventHandler;\nexport declare type TokenManagerAnyEvent = typeof EVENT_RENEWED | typeof EVENT_ERROR | typeof EVENT_SET_STORAGE | typeof EVENT_EXPIRED | typeof EVENT_ADDED | typeof EVENT_REMOVED;\n\n// only add methods needed internally\nexport interface TokenManagerInterface {\n on(event: typeof EVENT_RENEWED, handler: TokenManagerRenewEventHandler, context?: object): void;\n on(event: typeof EVENT_ERROR, handler: TokenManagerErrorEventHandler, context?: object): void;\n on(event: typeof EVENT_SET_STORAGE, handler: TokenManagerSetStorageEventHandler, context?: object): void;\n on(event: typeof EVENT_EXPIRED | typeof EVENT_ADDED | typeof EVENT_REMOVED, handler: TokenManagerEventHandler, context?: object): void;\n\n off(event: typeof EVENT_RENEWED, handler?: TokenManagerRenewEventHandler): void;\n off(event: typeof EVENT_ERROR, handler?: TokenManagerErrorEventHandler): void;\n off(event: typeof EVENT_SET_STORAGE, handler?: TokenManagerSetStorageEventHandler): void;\n off(event: typeof EVENT_EXPIRED | typeof EVENT_ADDED | typeof EVENT_REMOVED, handler?: TokenManagerEventHandler): void;\n\n clear(): void;\n setExpireEventTimeout(key: string, token: Token): void;\n clearExpireEventTimeout(key: string): void;\n clearExpireEventTimeoutAll(): void;\n emitAdded(key: string, token: Token): void;\n emitError(error: Error): void;\n emitRemoved(key: string, token: Token): void;\n emitRenewed(key: string, token: Token, oldToken?: Token): void;\n renew(key: string): Promise<Token | undefined>;\n remove(key: string): void;\n hasExpired(token: Token): boolean;\n getExpireTime(token: Token): number;\n\n get(key): Promise<Token>;\n getSync(key): Token;\n getTokens(): Promise<Tokens>;\n getTokensSync(): Tokens;\n setTokens({ accessToken, idToken, refreshToken }: Tokens, accessTokenCb?: AccessTokenCallback, idTokenCb?: IDTokenCallback, refreshTokenCb?: RefreshTokenCallback): void;\n getStorageKeyByType(type: TokenType): string;\n add(key: any, token: Token): void;\n updateRefreshToken(token: RefreshToken);\n removeRefreshToken(): void;\n clearPendingRemoveTokens(): void;\n\n getOptions(): TokenManagerOptions;\n getStorage(): StorageProvider;\n\n start();\n stop();\n isStarted(): boolean;\n}\n"],"mappings":";;;AAAA;;AAiBO,MAAMA,aAAa,GAAG,SAAS;AAAC;AAChC,MAAMC,aAAa,GAAG,SAAS;AAAC;AAChC,MAAMC,WAAW,GAAG,OAAO;AAAC;AAC5B,MAAMC,aAAa,GAAG,SAAS;AAAC;AAChC,MAAMC,WAAW,GAAG,OAAO;AAAC;AAC5B,MAAMC,iBAAiB,GAAG,aAAa;AAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","names":[],"sources":["../../../../lib/oidc/types/api.ts"],"sourcesContent":["/*!\n * Copyright (c) 2021-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\nimport { JWTObject } from './JWT';\nimport { OAuthTransactionMeta, PKCETransactionMeta } from './meta';\nimport { CustomUrls, OktaAuthOAuthOptions, SigninWithRedirectOptions, TokenParams } from './options';\nimport { OAuthStorageManagerInterface } from './storage';\nimport { AccessToken, IDToken, RefreshToken, RevocableToken, Token, Tokens } from './Token';\nimport { TokenManagerInterface } from './TokenManager';\nimport { CustomUserClaims, UserClaims } from './UserClaims';\nimport { TransactionManagerInterface } from './TransactionManager';\nimport { OktaAuthSessionInterface } from '../../session/types';\n\nexport interface PopupParams {\n popupTitle?: string;\n popupWindow?: Window;\n}\n\nexport interface TokenResponse {\n tokens: Tokens;\n state: string;\n code?: string;\n}\n\nexport interface ParseFromUrlOptions {\n url?: string;\n responseMode?: string;\n}\n\nexport type ParseFromUrlFunction = (options?: string | ParseFromUrlOptions) => Promise<TokenResponse>;\n\nexport interface ParseFromUrlInterface extends ParseFromUrlFunction {\n _getDocument: () => Document;\n _getLocation: () => Location;\n _getHistory: () => History;\n}\n\nexport type GetWithRedirectFunction = (params?: TokenParams) => Promise<void>;\n\nexport type SetLocationFunction = (loc: string) => void;\n\nexport interface
|
|
1
|
+
{"version":3,"file":"api.js","names":[],"sources":["../../../../lib/oidc/types/api.ts"],"sourcesContent":["/*!\n * Copyright (c) 2021-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\nimport { JWTObject } from './JWT';\nimport { OAuthTransactionMeta, PKCETransactionMeta } from './meta';\nimport { CustomUrls, OktaAuthOAuthOptions, SigninWithRedirectOptions, TokenParams } from './options';\nimport { OAuthResponseType } from './proto';\nimport { OAuthStorageManagerInterface } from './storage';\nimport { AccessToken, IDToken, RefreshToken, RevocableToken, Token, Tokens } from './Token';\nimport { TokenManagerInterface } from './TokenManager';\nimport { CustomUserClaims, UserClaims } from './UserClaims';\nimport { TransactionManagerInterface } from './TransactionManager';\nimport { OktaAuthSessionInterface } from '../../session/types';\nimport { Endpoints } from './endpoints';\n\nexport interface PopupParams {\n popupTitle?: string;\n popupWindow?: Window;\n}\n\nexport interface TokenResponse {\n tokens: Tokens;\n state: string;\n code?: string;\n responseType?: OAuthResponseType | OAuthResponseType[] | 'none';\n}\n\nexport interface ParseFromUrlOptions {\n url?: string;\n responseMode?: string;\n}\n\nexport type ParseFromUrlFunction = (options?: string | ParseFromUrlOptions) => Promise<TokenResponse>;\n\nexport interface ParseFromUrlInterface extends ParseFromUrlFunction {\n _getDocument: () => Document;\n _getLocation: () => Location;\n _getHistory: () => History;\n}\n\nexport type GetWithRedirectFunction = (params?: TokenParams) => Promise<void>;\n\nexport type SetLocationFunction = (loc: string) => void;\n\nexport interface BaseTokenAPI {\n decode(token: string): JWTObject;\n prepareTokenParams(params?: TokenParams): Promise<TokenParams>;\n exchangeCodeForTokens(params: TokenParams, urls?: CustomUrls): Promise<TokenResponse>;\n}\n\nexport interface TokenAPI extends BaseTokenAPI {\n getUserInfo<S extends CustomUserClaims = CustomUserClaims>(\n accessToken?: AccessToken,\n idToken?: IDToken\n ): Promise<UserClaims<S>>;\n getWithRedirect: GetWithRedirectFunction;\n parseFromUrl: ParseFromUrlInterface;\n getWithoutPrompt(params?: TokenParams): Promise<TokenResponse>;\n getWithPopup(params?: TokenParams): Promise<TokenResponse>;\n revoke(token: RevocableToken): Promise<object>;\n renew(token: Token): Promise<Token | undefined>;\n renewTokens(options?: TokenParams): Promise<Tokens>;\n renewTokensWithRefresh(tokenParams: TokenParams, refreshTokenObject: RefreshToken): Promise<Tokens>;\n verify(token: IDToken, params?: object): Promise<IDToken>;\n isLoginRedirect(): boolean;\n}\n\nexport interface TokenVerifyParams {\n clientId: string;\n issuer: string;\n ignoreSignature?: boolean;\n nonce?: string;\n accessToken?: string; // raw access token string\n acrValues?: string;\n}\n\nexport interface IDTokenAPI {\n authorize: {\n _getLocationHref: () => string;\n };\n}\n\nexport interface PkceAPI {\n DEFAULT_CODE_CHALLENGE_METHOD: string;\n generateVerifier(prefix: string): string;\n computeChallenge(str: string): PromiseLike<any>;\n}\n\nexport interface IsAuthenticatedOptions {\n onExpiredToken?: 'renew' | 'remove' | 'none';\n}\n\nexport interface SignoutRedirectUrlOptions {\n postLogoutRedirectUri?: string;\n idToken?: IDToken;\n state?: string;\n}\n\nexport interface SignoutOptions extends SignoutRedirectUrlOptions {\n revokeAccessToken?: boolean;\n revokeRefreshToken?: boolean;\n accessToken?: AccessToken;\n refreshToken?: RefreshToken;\n clearTokensBeforeRedirect?: boolean;\n}\n\nexport interface OriginalUriApi {\n getOriginalUri(state?: string): string | undefined;\n setOriginalUri(originalUri: string, state?: string): void;\n removeOriginalUri(state?: string): void;\n}\n\nexport interface OktaAuthOAuthInterface\n<\n M extends OAuthTransactionMeta = PKCETransactionMeta,\n S extends OAuthStorageManagerInterface<M> = OAuthStorageManagerInterface<M>,\n O extends OktaAuthOAuthOptions = OktaAuthOAuthOptions,\n TM extends TransactionManagerInterface = TransactionManagerInterface\n> \n extends OktaAuthSessionInterface<S, O>,\n OriginalUriApi\n{\n token: TokenAPI;\n tokenManager: TokenManagerInterface;\n pkce: PkceAPI;\n transactionManager: TM;\n endpoints: Endpoints;\n \n isPKCE(): boolean;\n getIdToken(): string | undefined;\n getAccessToken(): string | undefined;\n getRefreshToken(): string | undefined;\n\n isAuthenticated(options?: IsAuthenticatedOptions): Promise<boolean>;\n signOut(opts?: SignoutOptions): Promise<void>;\n isLoginRedirect(): boolean;\n storeTokensFromRedirect(): Promise<void>;\n getUser<T extends CustomUserClaims = CustomUserClaims>(): Promise<UserClaims<T>>;\n signInWithRedirect(opts?: SigninWithRedirectOptions): Promise<void>;\n \n revokeAccessToken(accessToken?: AccessToken): Promise<unknown>;\n revokeRefreshToken(refreshToken?: RefreshToken): Promise<unknown>;\n}\n"],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"endpoints.js","names":[],"sources":["../../../../lib/oidc/types/endpoints.ts"],"sourcesContent":["/*!\n * Copyright (c) 2021-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\nimport {\n EnrollAuthenticatorOptions\n} from './options';\n\nexport type EnrollAuthenticatorFunction = (params: EnrollAuthenticatorOptions) => void;\n\nexport interface Endpoints {\n authorize: {\n enrollAuthenticator: EnrollAuthenticatorFunction;\n }\n}\n"],"mappings":""}
|
package/cjs/oidc/types/index.js
CHANGED
|
@@ -121,4 +121,15 @@ Object.keys(_UserClaims).forEach(function (key) {
|
|
|
121
121
|
}
|
|
122
122
|
});
|
|
123
123
|
});
|
|
124
|
+
var _endpoints = require("./endpoints");
|
|
125
|
+
Object.keys(_endpoints).forEach(function (key) {
|
|
126
|
+
if (key === "default" || key === "__esModule") return;
|
|
127
|
+
if (key in exports && exports[key] === _endpoints[key]) return;
|
|
128
|
+
Object.defineProperty(exports, key, {
|
|
129
|
+
enumerable: true,
|
|
130
|
+
get: function () {
|
|
131
|
+
return _endpoints[key];
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
});
|
|
124
135
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../lib/oidc/types/index.ts"],"sourcesContent":["/*!\n * Copyright (c) 2021-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\nexport * from './api';\nexport * from './JWT';\nexport * from './meta';\nexport * from './options';\nexport * from './proto';\nexport * from './storage';\nexport * from './Token';\nexport * from './TokenManager';\nexport * from './Transaction';\nexport * from './TransactionManager';\nexport * from './UserClaims';\n"],"mappings":";;AAYA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../lib/oidc/types/index.ts"],"sourcesContent":["/*!\n * Copyright (c) 2021-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\nexport * from './api';\nexport * from './JWT';\nexport * from './meta';\nexport * from './options';\nexport * from './proto';\nexport * from './storage';\nexport * from './Token';\nexport * from './TokenManager';\nexport * from './Transaction';\nexport * from './TransactionManager';\nexport * from './UserClaims';\nexport * from './endpoints';\n"],"mappings":";;AAYA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"meta.js","names":[],"sources":["../../../../lib/oidc/types/meta.ts"],"sourcesContent":["/*!\n * Copyright (c) 2021-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\nimport { CustomUrls, TokenParams } from './options';\n\n// formerly known as \"Redirect OAuth Params\"\nexport interface OAuthTransactionMeta extends\n Pick<TokenParams,\n 'issuer' |\n 'clientId' |\n 'redirectUri' |\n 'responseType' |\n 'responseMode' |\n 'scopes' |\n 'state' |\n 'pkce' |\n 'ignoreSignature' |\n 'nonce' |\n 'acrValues'\n >\n{\n urls: CustomUrls;\n originalUri?: string;\n}\n\nexport interface PKCETransactionMeta extends\n OAuthTransactionMeta,\n Pick<TokenParams,\n 'codeChallenge' |\n 'codeChallengeMethod' |\n 'codeVerifier'\n >\n{}\n\nexport interface TransactionMetaOptions extends\n Pick<PKCETransactionMeta,\n 'state' |\n 'codeChallenge' |\n 'codeChallengeMethod' |\n 'codeVerifier'\n >\n{\n muteWarning?: boolean;\n}\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"meta.js","names":[],"sources":["../../../../lib/oidc/types/meta.ts"],"sourcesContent":["/*!\n * Copyright (c) 2021-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\nimport { CustomUrls, TokenParams } from './options';\n\n// formerly known as \"Redirect OAuth Params\"\nexport interface OAuthTransactionMeta extends\n Pick<TokenParams,\n 'issuer' |\n 'clientId' |\n 'redirectUri' |\n 'responseType' |\n 'responseMode' |\n 'scopes' |\n 'state' |\n 'pkce' |\n 'ignoreSignature' |\n 'nonce' |\n 'acrValues' |\n 'enrollAmrValues'\n >\n{\n urls: CustomUrls;\n originalUri?: string;\n}\n\nexport interface PKCETransactionMeta extends\n OAuthTransactionMeta,\n Pick<TokenParams,\n 'codeChallenge' |\n 'codeChallengeMethod' |\n 'codeVerifier'\n >\n{}\n\nexport interface TransactionMetaOptions extends\n Pick<PKCETransactionMeta,\n 'state' |\n 'codeChallenge' |\n 'codeChallengeMethod' |\n 'codeVerifier'\n >\n{\n muteWarning?: boolean;\n}\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.js","names":[],"sources":["../../../../lib/oidc/types/options.ts"],"sourcesContent":["/*!\n * Copyright (c) 2021-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\nimport { OktaAuthOptionsConstructor } from '../../base/types';\nimport { OktaAuthHttpOptions } from '../../http/types';\nimport { SimpleStorage } from '../../storage/types';\nimport { OktaAuthOAuthInterface, SetLocationFunction } from './api';\nimport { OAuthResponseMode, OAuthResponseType } from './proto';\nimport { TransactionManagerOptions } from './Transaction';\n\nexport interface CustomUrls {\n issuer?: string;\n authorizeUrl?: string;\n userinfoUrl?: string;\n tokenUrl?: string;\n revokeUrl?: string;\n logoutUrl?: string;\n}\n\nexport interface TokenParams extends CustomUrls {\n pkce?: boolean;\n clientId?: string;\n redirectUri?: string;\n responseType?: OAuthResponseType | OAuthResponseType[];\n responseMode?: OAuthResponseMode;\n state?: string;\n nonce?: string;\n scopes?: string[];\n display?: string;\n ignoreSignature?: boolean;\n codeVerifier?: string;\n authorizationCode?: string;\n codeChallenge?: string;\n codeChallengeMethod?: string;\n interactionCode?: string;\n idp?: string;\n idpScope?: string | string[];\n loginHint?: string;\n maxAge?: string | number;\n acrValues?: string;\n prompt?: string;\n sessionToken?: string;\n timeout?: number;\n extraParams?: { [propName: string]: string }; // custom authorize query params\n // TODO: remove in the next major version\n popupTitle?: string;\n}\n\nexport interface TokenManagerOptions {\n autoRenew?: boolean;\n autoRemove?: boolean;\n clearPendingRemoveTokens?: boolean;\n secure?: boolean;\n storage?: string | SimpleStorage;\n storageKey?: string;\n expireEarlySeconds?: number;\n syncStorage?: boolean;\n}\n\nexport interface SigninWithRedirectOptions extends TokenParams {\n originalUri?: string;\n}\n\nexport interface OktaAuthOAuthOptions extends\n OktaAuthHttpOptions,\n CustomUrls,\n Pick<TokenParams,\n 'issuer' |\n 'clientId' |\n 'redirectUri' |\n 'responseType' |\n 'responseMode' |\n 'scopes' |\n 'state' |\n 'pkce' |\n 'ignoreSignature' |\n 'codeChallenge' |\n 'codeChallengeMethod' |\n 'maxAge' |\n 'acrValues'\n >\n{\n ignoreLifetime?: boolean;\n tokenManager?: TokenManagerOptions;\n postLogoutRedirectUri?: string;\n maxClockSkew?: number;\n restoreOriginalUri?: (oktaAuth: OktaAuthOAuthInterface, originalUri?: string) => Promise<void>;\n\n transactionManager?: TransactionManagerOptions;\n\n // For server-side web applications ONLY!\n clientSecret?: string;\n setLocation?: SetLocationFunction;\n}\n\nexport type OktaAuthOauthOptionsConstructor = OktaAuthOptionsConstructor<OktaAuthOAuthOptions>;\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"options.js","names":[],"sources":["../../../../lib/oidc/types/options.ts"],"sourcesContent":["/*!\n * Copyright (c) 2021-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\nimport { OktaAuthOptionsConstructor } from '../../base/types';\nimport { OktaAuthHttpOptions } from '../../http/types';\nimport { SimpleStorage } from '../../storage/types';\nimport { OktaAuthOAuthInterface, SetLocationFunction } from './api';\nimport { OAuthResponseMode, OAuthResponseType } from './proto';\nimport { TransactionManagerOptions } from './Transaction';\n\nexport interface CustomUrls {\n issuer?: string;\n authorizeUrl?: string;\n userinfoUrl?: string;\n tokenUrl?: string;\n revokeUrl?: string;\n logoutUrl?: string;\n}\n\nexport interface TokenParams extends CustomUrls {\n pkce?: boolean;\n clientId?: string;\n redirectUri?: string;\n responseType?: OAuthResponseType | OAuthResponseType[] | 'none';\n responseMode?: OAuthResponseMode;\n state?: string;\n nonce?: string;\n scopes?: string[];\n enrollAmrValues?: string | string[];\n display?: string;\n ignoreSignature?: boolean;\n codeVerifier?: string;\n authorizationCode?: string;\n codeChallenge?: string;\n codeChallengeMethod?: string;\n interactionCode?: string;\n idp?: string;\n idpScope?: string | string[];\n loginHint?: string;\n maxAge?: string | number;\n acrValues?: string;\n prompt?: string;\n sessionToken?: string;\n timeout?: number;\n extraParams?: { [propName: string]: string }; // custom authorize query params\n // TODO: remove in the next major version\n popupTitle?: string;\n}\n\nexport interface TokenManagerOptions {\n autoRenew?: boolean;\n autoRemove?: boolean;\n clearPendingRemoveTokens?: boolean;\n secure?: boolean;\n storage?: string | SimpleStorage;\n storageKey?: string;\n expireEarlySeconds?: number;\n syncStorage?: boolean;\n}\n\nexport interface EnrollAuthenticatorOptions extends TokenParams {\n enrollAmrValues: string | string[];\n acrValues: string;\n}\n\nexport interface SigninWithRedirectOptions extends TokenParams {\n originalUri?: string;\n}\n\nexport interface OktaAuthOAuthOptions extends\n OktaAuthHttpOptions,\n CustomUrls,\n Pick<TokenParams,\n 'issuer' |\n 'clientId' |\n 'redirectUri' |\n 'responseType' |\n 'responseMode' |\n 'scopes' |\n 'state' |\n 'pkce' |\n 'ignoreSignature' |\n 'codeChallenge' |\n 'codeChallengeMethod' |\n 'maxAge' |\n 'acrValues'\n >\n{\n ignoreLifetime?: boolean;\n tokenManager?: TokenManagerOptions;\n postLogoutRedirectUri?: string;\n maxClockSkew?: number;\n restoreOriginalUri?: (oktaAuth: OktaAuthOAuthInterface, originalUri?: string) => Promise<void>;\n\n transactionManager?: TransactionManagerOptions;\n\n // For server-side web applications ONLY!\n clientSecret?: string;\n setLocation?: SetLocationFunction;\n}\n\nexport type OktaAuthOauthOptionsConstructor = OktaAuthOptionsConstructor<OktaAuthOAuthOptions>;\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proto.js","names":[],"sources":["../../../../lib/oidc/types/proto.ts"],"sourcesContent":["/* eslint-disable camelcase */\n/*!\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\nexport interface OAuthParams {\n client_id?: string;\n code_challenge?: string;\n code_challenge_method?: string;\n display?: string;\n idp?: string;\n idp_scope?: string | string[];\n login_hint?: string;\n max_age?: string | number;\n nonce?: string;\n prompt?: string;\n redirect_uri?: string;\n response_mode?: string;\n response_type?: string | string[];\n scope?: string;\n sessionToken?: string;\n state?: string;\n grant_type?: string;\n code?: string;\n interaction_code?: string;\n acr_values?: string;\n}\n\nexport interface OAuthResponse {\n state?: string;\n code?: string;\n interaction_code?: string;\n expires_in?: string;\n token_type?: string;\n access_token?: string;\n id_token?: string;\n refresh_token?: string;\n scope?: string;\n error?: string;\n error_description?: string;\n}\n\nexport interface WellKnownResponse {\n issuer: string;\n authorization_endpoint: string;\n userinfo_endpoint: string;\n jwks_uri: string;\n response_types_supported: string[];\n response_modes_supported: string[];\n grant_types_supported: string[];\n subject_types_supported: string[];\n id_token_signing_alg_values_supported: string[];\n scopes_supported: string[];\n claims_supported: string[];\n}\n\n\nexport type OAuthResponseMode = 'okta_post_message' |'fragment' |'query' |'form_post';\n\nexport type OAuthResponseType = 'code' |'token' |'id_token' | 'refresh_token';\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"proto.js","names":[],"sources":["../../../../lib/oidc/types/proto.ts"],"sourcesContent":["/* eslint-disable camelcase */\n/*!\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\nexport interface OAuthParams {\n client_id?: string;\n code_challenge?: string;\n code_challenge_method?: string;\n display?: string;\n idp?: string;\n idp_scope?: string | string[];\n login_hint?: string;\n max_age?: string | number;\n nonce?: string;\n prompt?: string;\n redirect_uri?: string;\n response_mode?: string;\n response_type?: string | string[];\n scope?: string;\n sessionToken?: string;\n state?: string;\n grant_type?: string;\n code?: string;\n interaction_code?: string;\n acr_values?: string;\n enroll_amr_values?: string | string[];\n}\n\nexport interface OAuthResponse {\n state?: string;\n code?: string;\n interaction_code?: string;\n expires_in?: string;\n token_type?: string;\n access_token?: string;\n id_token?: string;\n refresh_token?: string;\n scope?: string;\n error?: string;\n error_description?: string;\n}\n\nexport interface WellKnownResponse {\n issuer: string;\n authorization_endpoint: string;\n userinfo_endpoint: string;\n jwks_uri: string;\n response_types_supported: string[];\n response_modes_supported: string[];\n grant_types_supported: string[];\n subject_types_supported: string[];\n id_token_signing_alg_values_supported: string[];\n scopes_supported: string[];\n claims_supported: string[];\n}\n\n\nexport type OAuthResponseMode = 'okta_post_message' |'fragment' |'query' |'form_post';\n\nexport type OAuthResponseType = 'code' |'token' |'id_token' | 'refresh_token';\n"],"mappings":""}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.getDefaultEnrollAuthenticatorParams = getDefaultEnrollAuthenticatorParams;
|
|
4
|
+
var _oauth = require("./oauth");
|
|
5
|
+
var _features = require("../../features");
|
|
6
|
+
var _util = require("../../util");
|
|
7
|
+
/* global window */
|
|
8
|
+
/*!
|
|
9
|
+
* Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.
|
|
10
|
+
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
|
|
11
|
+
*
|
|
12
|
+
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
15
|
+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
*
|
|
17
|
+
* See the License for the specific language governing permissions and limitations under the License.
|
|
18
|
+
*
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
function getDefaultEnrollAuthenticatorParams(sdk) {
|
|
22
|
+
const {
|
|
23
|
+
clientId,
|
|
24
|
+
redirectUri,
|
|
25
|
+
responseMode,
|
|
26
|
+
state
|
|
27
|
+
} = sdk.options;
|
|
28
|
+
const defaultRedirectUri = (0, _features.isBrowser)() ? window.location.href : undefined;
|
|
29
|
+
return (0, _util.removeNils)({
|
|
30
|
+
clientId,
|
|
31
|
+
redirectUri: redirectUri || defaultRedirectUri,
|
|
32
|
+
responseMode,
|
|
33
|
+
state: state || (0, _oauth.generateState)(),
|
|
34
|
+
responseType: 'none',
|
|
35
|
+
prompt: 'enroll_authenticator'
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=defaultEnrollAuthenticatorParams.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaultEnrollAuthenticatorParams.js","names":["getDefaultEnrollAuthenticatorParams","sdk","clientId","redirectUri","responseMode","state","options","defaultRedirectUri","isBrowser","window","location","href","undefined","removeNils","generateState","responseType","prompt"],"sources":["../../../../lib/oidc/util/defaultEnrollAuthenticatorParams.ts"],"sourcesContent":["\n/* global window */\n/*!\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 */\nimport { generateState } from './oauth';\nimport { OktaAuthOAuthInterface, TokenParams } from '../types';\nimport { isBrowser } from '../../features';\nimport { removeNils } from '../../util';\n\nexport function getDefaultEnrollAuthenticatorParams(sdk: OktaAuthOAuthInterface): TokenParams {\n const {\n clientId,\n redirectUri,\n responseMode,\n state,\n } = sdk.options;\n const defaultRedirectUri = isBrowser() ? window.location.href : undefined;\n return removeNils({\n clientId,\n redirectUri: redirectUri || defaultRedirectUri,\n responseMode,\n state: state || generateState(),\n responseType: 'none',\n prompt: 'enroll_authenticator',\n });\n}"],"mappings":";;;AAcA;AAEA;AACA;AAhBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAMO,SAASA,mCAAmC,CAACC,GAA2B,EAAe;EAC5F,MAAM;IACJC,QAAQ;IACRC,WAAW;IACXC,YAAY;IACZC;EACF,CAAC,GAAGJ,GAAG,CAACK,OAAO;EACf,MAAMC,kBAAkB,GAAG,IAAAC,mBAAS,GAAE,GAAGC,MAAM,CAACC,QAAQ,CAACC,IAAI,GAAGC,SAAS;EACzE,OAAO,IAAAC,gBAAU,EAAC;IAChBX,QAAQ;IACRC,WAAW,EAAEA,WAAW,IAAII,kBAAkB;IAC9CH,YAAY;IACZC,KAAK,EAAEA,KAAK,IAAI,IAAAS,oBAAa,GAAE;IAC/BC,YAAY,EAAE,MAAM;IACpBC,MAAM,EAAE;EACV,CAAC,CAAC;AACJ"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.createEnrollAuthenticatorMeta = createEnrollAuthenticatorMeta;
|
|
4
|
+
var _oauth = require("./oauth");
|
|
5
|
+
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
|
6
|
+
|
|
7
|
+
function createEnrollAuthenticatorMeta(sdk, params) {
|
|
8
|
+
const issuer = sdk.options.issuer;
|
|
9
|
+
const urls = (0, _oauth.getOAuthUrls)(sdk, params);
|
|
10
|
+
const oauthMeta = {
|
|
11
|
+
issuer,
|
|
12
|
+
urls,
|
|
13
|
+
clientId: params.clientId,
|
|
14
|
+
redirectUri: params.redirectUri,
|
|
15
|
+
responseType: params.responseType,
|
|
16
|
+
responseMode: params.responseMode,
|
|
17
|
+
state: params.state,
|
|
18
|
+
acrValues: params.acrValues,
|
|
19
|
+
enrollAmrValues: params.enrollAmrValues
|
|
20
|
+
};
|
|
21
|
+
return oauthMeta;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=enrollAuthenticatorMeta.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enrollAuthenticatorMeta.js","names":["createEnrollAuthenticatorMeta","sdk","params","issuer","options","urls","getOAuthUrls","oauthMeta","clientId","redirectUri","responseType","responseMode","state","acrValues","enrollAmrValues"],"sources":["../../../../lib/oidc/util/enrollAuthenticatorMeta.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-non-null-assertion */\nimport { OAuthTransactionMeta, OktaAuthOAuthInterface, EnrollAuthenticatorOptions } from '../types';\nimport { getOAuthUrls } from './oauth';\n\nexport function createEnrollAuthenticatorMeta(\n sdk: OktaAuthOAuthInterface, \n params: EnrollAuthenticatorOptions\n): OAuthTransactionMeta {\n const issuer = sdk.options.issuer!;\n const urls = getOAuthUrls(sdk, params);\n const oauthMeta: OAuthTransactionMeta = {\n issuer,\n urls,\n clientId: params.clientId!,\n redirectUri: params.redirectUri!,\n responseType: params.responseType!,\n responseMode: params.responseMode!,\n state: params.state!,\n acrValues: params.acrValues,\n enrollAmrValues: params.enrollAmrValues,\n };\n\n return oauthMeta;\n}\n"],"mappings":";;;AAEA;AAFA;;AAIO,SAASA,6BAA6B,CAC3CC,GAA2B,EAC3BC,MAAkC,EACZ;EACtB,MAAMC,MAAM,GAAGF,GAAG,CAACG,OAAO,CAACD,MAAO;EAClC,MAAME,IAAI,GAAG,IAAAC,mBAAY,EAACL,GAAG,EAAEC,MAAM,CAAC;EACtC,MAAMK,SAA+B,GAAG;IACtCJ,MAAM;IACNE,IAAI;IACJG,QAAQ,EAAEN,MAAM,CAACM,QAAS;IAC1BC,WAAW,EAAEP,MAAM,CAACO,WAAY;IAChCC,YAAY,EAAER,MAAM,CAACQ,YAAa;IAClCC,YAAY,EAAET,MAAM,CAACS,YAAa;IAClCC,KAAK,EAAEV,MAAM,CAACU,KAAM;IACpBC,SAAS,EAAEX,MAAM,CAACW,SAAS;IAC3BC,eAAe,EAAEZ,MAAM,CAACY;EAC1B,CAAC;EAED,OAAOP,SAAS;AAClB"}
|
package/cjs/oidc/util/index.js
CHANGED
|
@@ -34,6 +34,18 @@ Object.keys(_defaultTokenParams).forEach(function (key) {
|
|
|
34
34
|
}
|
|
35
35
|
});
|
|
36
36
|
});
|
|
37
|
+
var _defaultEnrollAuthenticatorParams = require("./defaultEnrollAuthenticatorParams");
|
|
38
|
+
Object.keys(_defaultEnrollAuthenticatorParams).forEach(function (key) {
|
|
39
|
+
if (key === "default" || key === "__esModule") return;
|
|
40
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
41
|
+
if (key in exports && exports[key] === _defaultEnrollAuthenticatorParams[key]) return;
|
|
42
|
+
Object.defineProperty(exports, key, {
|
|
43
|
+
enumerable: true,
|
|
44
|
+
get: function () {
|
|
45
|
+
return _defaultEnrollAuthenticatorParams[key];
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
});
|
|
37
49
|
var _errors = require("./errors");
|
|
38
50
|
Object.keys(_errors).forEach(function (key) {
|
|
39
51
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -82,6 +94,18 @@ Object.keys(_oauthMeta).forEach(function (key) {
|
|
|
82
94
|
}
|
|
83
95
|
});
|
|
84
96
|
});
|
|
97
|
+
var _enrollAuthenticatorMeta = require("./enrollAuthenticatorMeta");
|
|
98
|
+
Object.keys(_enrollAuthenticatorMeta).forEach(function (key) {
|
|
99
|
+
if (key === "default" || key === "__esModule") return;
|
|
100
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
101
|
+
if (key in exports && exports[key] === _enrollAuthenticatorMeta[key]) return;
|
|
102
|
+
Object.defineProperty(exports, key, {
|
|
103
|
+
enumerable: true,
|
|
104
|
+
get: function () {
|
|
105
|
+
return _enrollAuthenticatorMeta[key];
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
});
|
|
85
109
|
var _pkce = _interopRequireDefault(require("./pkce"));
|
|
86
110
|
var _prepareTokenParams = require("./prepareTokenParams");
|
|
87
111
|
Object.keys(_prepareTokenParams).forEach(function (key) {
|
|
@@ -95,6 +119,18 @@ Object.keys(_prepareTokenParams).forEach(function (key) {
|
|
|
95
119
|
}
|
|
96
120
|
});
|
|
97
121
|
});
|
|
122
|
+
var _prepareEnrollAuthenticatorParams = require("./prepareEnrollAuthenticatorParams");
|
|
123
|
+
Object.keys(_prepareEnrollAuthenticatorParams).forEach(function (key) {
|
|
124
|
+
if (key === "default" || key === "__esModule") return;
|
|
125
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
126
|
+
if (key in exports && exports[key] === _prepareEnrollAuthenticatorParams[key]) return;
|
|
127
|
+
Object.defineProperty(exports, key, {
|
|
128
|
+
enumerable: true,
|
|
129
|
+
get: function () {
|
|
130
|
+
return _prepareEnrollAuthenticatorParams[key];
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
});
|
|
98
134
|
var _refreshToken = require("./refreshToken");
|
|
99
135
|
Object.keys(_refreshToken).forEach(function (key) {
|
|
100
136
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../lib/oidc/util/index.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\nexport * from './browser';\nexport * from './defaultTokenParams';\nexport * from './errors';\nexport * from './loginRedirect';\nexport * from './oauth';\nexport * from './oauthMeta';\nimport pkce from './pkce';\nexport { pkce };\nexport * from './prepareTokenParams';\nexport * from './refreshToken';\nexport * from './urlParams';\nexport * from './validateClaims';\nexport * from './validateToken';\n"],"mappings":";;;;;;;;;;;;AAcA;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAEA;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../lib/oidc/util/index.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\nexport * from './browser';\nexport * from './defaultTokenParams';\nexport * from './defaultEnrollAuthenticatorParams';\nexport * from './errors';\nexport * from './loginRedirect';\nexport * from './oauth';\nexport * from './oauthMeta';\nexport * from './enrollAuthenticatorMeta';\nimport pkce from './pkce';\nexport { pkce };\nexport * from './prepareTokenParams';\nexport * from './prepareEnrollAuthenticatorParams';\nexport * from './refreshToken';\nexport * from './urlParams';\nexport * from './validateClaims';\nexport * from './validateToken';\n"],"mappings":";;;;;;;;;;;;AAcA;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAEA;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.prepareEnrollAuthenticatorParams = prepareEnrollAuthenticatorParams;
|
|
4
|
+
var _errors = require("../../errors");
|
|
5
|
+
var _defaultEnrollAuthenticatorParams = require("./defaultEnrollAuthenticatorParams");
|
|
6
|
+
/* eslint-disable complexity */
|
|
7
|
+
/*!
|
|
8
|
+
* Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.
|
|
9
|
+
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
|
|
10
|
+
*
|
|
11
|
+
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
14
|
+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
*
|
|
16
|
+
* See the License for the specific language governing permissions and limitations under the License.
|
|
17
|
+
*
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
function prepareParams(params) {
|
|
21
|
+
params = {
|
|
22
|
+
...params,
|
|
23
|
+
// forced params:
|
|
24
|
+
responseType: 'none',
|
|
25
|
+
prompt: 'enroll_authenticator',
|
|
26
|
+
maxAge: 0
|
|
27
|
+
};
|
|
28
|
+
if (!params.enrollAmrValues) {
|
|
29
|
+
throw new _errors.AuthSdkError('enroll_amr_values must be specified');
|
|
30
|
+
}
|
|
31
|
+
if (!params.acrValues) {
|
|
32
|
+
// `acr_values` is required and should equal 'urn:okta:2fa:any:ifpossible'
|
|
33
|
+
// But this can be changed in future
|
|
34
|
+
throw new _errors.AuthSdkError('acr_values must be specified');
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// `scope`, `nonce` must be omitted
|
|
38
|
+
delete params.scopes;
|
|
39
|
+
delete params.nonce;
|
|
40
|
+
return params;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// Prepares params for a call to /authorize
|
|
44
|
+
function prepareEnrollAuthenticatorParams(sdk, options) {
|
|
45
|
+
return prepareParams({
|
|
46
|
+
...(0, _defaultEnrollAuthenticatorParams.getDefaultEnrollAuthenticatorParams)(sdk),
|
|
47
|
+
...options
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=prepareEnrollAuthenticatorParams.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prepareEnrollAuthenticatorParams.js","names":["prepareParams","params","responseType","prompt","maxAge","enrollAmrValues","AuthSdkError","acrValues","scopes","nonce","prepareEnrollAuthenticatorParams","sdk","options","getDefaultEnrollAuthenticatorParams"],"sources":["../../../../lib/oidc/util/prepareEnrollAuthenticatorParams.ts"],"sourcesContent":["/* eslint-disable complexity */\n/*!\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 */\nimport { AuthSdkError } from '../../errors';\nimport { OktaAuthOAuthInterface, EnrollAuthenticatorOptions } from '../types';\nimport { getDefaultEnrollAuthenticatorParams } from './defaultEnrollAuthenticatorParams';\n\nfunction prepareParams(\n params: EnrollAuthenticatorOptions\n): EnrollAuthenticatorOptions {\n params = {\n ...params,\n // forced params:\n responseType: 'none',\n prompt: 'enroll_authenticator',\n maxAge: 0,\n };\n\n if (!params.enrollAmrValues) {\n throw new AuthSdkError('enroll_amr_values must be specified');\n }\n if (!params.acrValues) {\n // `acr_values` is required and should equal 'urn:okta:2fa:any:ifpossible'\n // But this can be changed in future\n throw new AuthSdkError('acr_values must be specified');\n }\n\n // `scope`, `nonce` must be omitted\n delete params.scopes;\n delete params.nonce;\n\n return params;\n}\n\n// Prepares params for a call to /authorize\nexport function prepareEnrollAuthenticatorParams(\n sdk: OktaAuthOAuthInterface,\n options: EnrollAuthenticatorOptions\n): EnrollAuthenticatorOptions {\n return prepareParams({\n ...getDefaultEnrollAuthenticatorParams(sdk),\n ...options\n });\n}\n"],"mappings":";;;AAaA;AAEA;AAfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAKA,SAASA,aAAa,CACpBC,MAAkC,EACN;EAC5BA,MAAM,GAAG;IACP,GAAGA,MAAM;IACT;IACAC,YAAY,EAAE,MAAM;IACpBC,MAAM,EAAE,sBAAsB;IAC9BC,MAAM,EAAE;EACV,CAAC;EAED,IAAI,CAACH,MAAM,CAACI,eAAe,EAAE;IAC3B,MAAM,IAAIC,oBAAY,CAAC,qCAAqC,CAAC;EAC/D;EACA,IAAI,CAACL,MAAM,CAACM,SAAS,EAAE;IACrB;IACA;IACA,MAAM,IAAID,oBAAY,CAAC,8BAA8B,CAAC;EACxD;;EAEA;EACA,OAAOL,MAAM,CAACO,MAAM;EACpB,OAAOP,MAAM,CAACQ,KAAK;EAEnB,OAAOR,MAAM;AACf;;AAEA;AACO,SAASS,gCAAgC,CAC9CC,GAA2B,EAC3BC,OAAmC,EACP;EAC5B,OAAOZ,aAAa,CAAC;IACnB,GAAG,IAAAa,qEAAmC,EAACF,GAAG,CAAC;IAC3C,GAAGC;EACL,CAAC,CAAC;AACJ"}
|
|
@@ -41,6 +41,16 @@ class AutoRenewService {
|
|
|
41
41
|
// If tokens sync storage is enabled, handle tokens expiration only in 1 leader tab
|
|
42
42
|
return !!this.options.syncStorage && (0, _features.isBrowser)();
|
|
43
43
|
}
|
|
44
|
+
processExpiredTokens() {
|
|
45
|
+
const tokenStorage = this.tokenManager.getStorage();
|
|
46
|
+
const tokens = tokenStorage.getStorage();
|
|
47
|
+
Object.keys(tokens).forEach(key => {
|
|
48
|
+
const token = tokens[key];
|
|
49
|
+
if (!(0, _types.isRefreshToken)(token) && this.tokenManager.hasExpired(token)) {
|
|
50
|
+
this.onTokenExpiredHandler(key);
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
}
|
|
44
54
|
onTokenExpiredHandler(key) {
|
|
45
55
|
if (this.options.autoRenew) {
|
|
46
56
|
if (this.shouldThrottleRenew()) {
|
|
@@ -60,6 +70,11 @@ class AutoRenewService {
|
|
|
60
70
|
if (this.canStart()) {
|
|
61
71
|
await this.stop();
|
|
62
72
|
this.tokenManager.on(_types.EVENT_EXPIRED, this.onTokenExpiredHandler);
|
|
73
|
+
if (this.tokenManager.isStarted()) {
|
|
74
|
+
// If token manager has been already started, we could miss token expire events,
|
|
75
|
+
// so need to process expired tokens manually.
|
|
76
|
+
this.processExpiredTokens();
|
|
77
|
+
}
|
|
63
78
|
this.started = true;
|
|
64
79
|
}
|
|
65
80
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AutoRenewService.js","names":["AutoRenewService","constructor","tokenManager","options","renewTimeQueue","onTokenExpiredHandler","bind","shouldThrottleRenew","res","push","Date","now","length","firstTime","shift","lastTime","requiresLeadership","syncStorage","isBrowser","key","autoRenew","error","AuthSdkError","emitError","renew","catch","autoRemove","remove","canStart","start","stop","on","EVENT_EXPIRED","
|
|
1
|
+
{"version":3,"file":"AutoRenewService.js","names":["AutoRenewService","constructor","tokenManager","options","renewTimeQueue","onTokenExpiredHandler","bind","shouldThrottleRenew","res","push","Date","now","length","firstTime","shift","lastTime","requiresLeadership","syncStorage","isBrowser","processExpiredTokens","tokenStorage","getStorage","tokens","Object","keys","forEach","key","token","isRefreshToken","hasExpired","autoRenew","error","AuthSdkError","emitError","renew","catch","autoRemove","remove","canStart","start","stop","on","EVENT_EXPIRED","isStarted","started","off"],"sources":["../../../lib/services/AutoRenewService.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\nimport { AuthSdkError } from '../errors';\nimport { ServiceInterface, ServiceManagerOptions } from '../core/types';\nimport { EVENT_EXPIRED, TokenManagerInterface, isRefreshToken } from '../oidc/types';\nimport { isBrowser } from '../features';\n\nexport class AutoRenewService implements ServiceInterface {\n private tokenManager: TokenManagerInterface;\n private options: ServiceManagerOptions;\n private renewTimeQueue: Array<number>;\n private started = false;\n\n constructor(tokenManager: TokenManagerInterface, options: ServiceManagerOptions = {}) {\n this.tokenManager = tokenManager;\n this.options = options;\n this.renewTimeQueue = [];\n this.onTokenExpiredHandler = this.onTokenExpiredHandler.bind(this);\n }\n \n private shouldThrottleRenew(): boolean {\n let res = false;\n this.renewTimeQueue.push(Date.now());\n if (this.renewTimeQueue.length >= 10) {\n // get and remove first item from queue\n const firstTime = this.renewTimeQueue.shift() as number;\n const lastTime = this.renewTimeQueue[this.renewTimeQueue.length - 1];\n res = (lastTime - firstTime) < 30 * 1000;\n }\n return res;\n }\n\n requiresLeadership() {\n // If tokens sync storage is enabled, handle tokens expiration only in 1 leader tab\n return !!this.options.syncStorage && isBrowser();\n }\n\n private processExpiredTokens() {\n const tokenStorage = this.tokenManager.getStorage();\n const tokens = tokenStorage.getStorage();\n Object.keys(tokens).forEach(key => {\n const token = tokens[key];\n if (!isRefreshToken(token) && this.tokenManager.hasExpired(token)) {\n this.onTokenExpiredHandler(key);\n }\n });\n }\n\n private onTokenExpiredHandler(key: string) {\n if (this.options.autoRenew) {\n if (this.shouldThrottleRenew()) {\n const error = new AuthSdkError('Too many token renew requests');\n this.tokenManager.emitError(error);\n } else {\n this.tokenManager.renew(key).catch(() => {}); // Renew errors will emit an \"error\" event \n }\n } else if (this.options.autoRemove) {\n this.tokenManager.remove(key);\n }\n }\n\n canStart() {\n return (!!this.options.autoRenew || !!this.options.autoRemove);\n }\n\n async start() {\n if (this.canStart()) {\n await this.stop();\n this.tokenManager.on(EVENT_EXPIRED, this.onTokenExpiredHandler);\n if (this.tokenManager.isStarted()) {\n // If token manager has been already started, we could miss token expire events,\n // so need to process expired tokens manually.\n this.processExpiredTokens();\n }\n this.started = true;\n }\n }\n\n async stop() {\n if (this.started) {\n this.tokenManager.off(EVENT_EXPIRED, this.onTokenExpiredHandler);\n this.renewTimeQueue = [];\n this.started = false;\n }\n }\n\n isStarted() {\n return this.started;\n }\n}\n"],"mappings":";;;;;AAaA;AAEA;AACA;AAhBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAQO,MAAMA,gBAAgB,CAA6B;EAMxDC,WAAW,CAACC,YAAmC,EAAEC,OAA8B,GAAG,CAAC,CAAC,EAAE;IAAA,+CAFpE,KAAK;IAGrB,IAAI,CAACD,YAAY,GAAGA,YAAY;IAChC,IAAI,CAACC,OAAO,GAAGA,OAAO;IACtB,IAAI,CAACC,cAAc,GAAG,EAAE;IACxB,IAAI,CAACC,qBAAqB,GAAG,IAAI,CAACA,qBAAqB,CAACC,IAAI,CAAC,IAAI,CAAC;EACpE;EAEQC,mBAAmB,GAAY;IACrC,IAAIC,GAAG,GAAG,KAAK;IACf,IAAI,CAACJ,cAAc,CAACK,IAAI,CAACC,IAAI,CAACC,GAAG,EAAE,CAAC;IACpC,IAAI,IAAI,CAACP,cAAc,CAACQ,MAAM,IAAI,EAAE,EAAE;MACpC;MACA,MAAMC,SAAS,GAAG,IAAI,CAACT,cAAc,CAACU,KAAK,EAAY;MACvD,MAAMC,QAAQ,GAAG,IAAI,CAACX,cAAc,CAAC,IAAI,CAACA,cAAc,CAACQ,MAAM,GAAG,CAAC,CAAC;MACpEJ,GAAG,GAAIO,QAAQ,GAAGF,SAAS,GAAI,EAAE,GAAG,IAAI;IAC1C;IACA,OAAOL,GAAG;EACZ;EAEAQ,kBAAkB,GAAG;IACnB;IACA,OAAO,CAAC,CAAC,IAAI,CAACb,OAAO,CAACc,WAAW,IAAI,IAAAC,mBAAS,GAAE;EAClD;EAEQC,oBAAoB,GAAG;IAC7B,MAAMC,YAAY,GAAG,IAAI,CAAClB,YAAY,CAACmB,UAAU,EAAE;IACnD,MAAMC,MAAM,GAAGF,YAAY,CAACC,UAAU,EAAE;IACxCE,MAAM,CAACC,IAAI,CAACF,MAAM,CAAC,CAACG,OAAO,CAACC,GAAG,IAAI;MACjC,MAAMC,KAAK,GAAGL,MAAM,CAACI,GAAG,CAAC;MACzB,IAAI,CAAC,IAAAE,qBAAc,EAACD,KAAK,CAAC,IAAI,IAAI,CAACzB,YAAY,CAAC2B,UAAU,CAACF,KAAK,CAAC,EAAE;QACjE,IAAI,CAACtB,qBAAqB,CAACqB,GAAG,CAAC;MACjC;IACF,CAAC,CAAC;EACJ;EAEQrB,qBAAqB,CAACqB,GAAW,EAAE;IACzC,IAAI,IAAI,CAACvB,OAAO,CAAC2B,SAAS,EAAE;MAC1B,IAAI,IAAI,CAACvB,mBAAmB,EAAE,EAAE;QAC9B,MAAMwB,KAAK,GAAG,IAAIC,oBAAY,CAAC,+BAA+B,CAAC;QAC/D,IAAI,CAAC9B,YAAY,CAAC+B,SAAS,CAACF,KAAK,CAAC;MACpC,CAAC,MAAM;QACL,IAAI,CAAC7B,YAAY,CAACgC,KAAK,CAACR,GAAG,CAAC,CAACS,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;MAChD;IACF,CAAC,MAAM,IAAI,IAAI,CAAChC,OAAO,CAACiC,UAAU,EAAE;MAClC,IAAI,CAAClC,YAAY,CAACmC,MAAM,CAACX,GAAG,CAAC;IAC/B;EACF;EAEAY,QAAQ,GAAG;IACT,OAAQ,CAAC,CAAC,IAAI,CAACnC,OAAO,CAAC2B,SAAS,IAAI,CAAC,CAAC,IAAI,CAAC3B,OAAO,CAACiC,UAAU;EAC/D;EAEA,MAAMG,KAAK,GAAG;IACZ,IAAI,IAAI,CAACD,QAAQ,EAAE,EAAE;MACnB,MAAM,IAAI,CAACE,IAAI,EAAE;MACjB,IAAI,CAACtC,YAAY,CAACuC,EAAE,CAACC,oBAAa,EAAE,IAAI,CAACrC,qBAAqB,CAAC;MAC/D,IAAI,IAAI,CAACH,YAAY,CAACyC,SAAS,EAAE,EAAE;QACjC;QACA;QACA,IAAI,CAACxB,oBAAoB,EAAE;MAC7B;MACA,IAAI,CAACyB,OAAO,GAAG,IAAI;IACrB;EACF;EAEA,MAAMJ,IAAI,GAAG;IACX,IAAI,IAAI,CAACI,OAAO,EAAE;MAChB,IAAI,CAAC1C,YAAY,CAAC2C,GAAG,CAACH,oBAAa,EAAE,IAAI,CAACrC,qBAAqB,CAAC;MAChE,IAAI,CAACD,cAAc,GAAG,EAAE;MACxB,IAAI,CAACwC,OAAO,GAAG,KAAK;IACtB;EACF;EAEAD,SAAS,GAAG;IACV,OAAO,IAAI,CAACC,OAAO;EACrB;AACF;AAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.jsonpath = jsonpath;
|
|
4
|
+
var _jsonpathPlus = require("jsonpath-plus");
|
|
5
|
+
function jsonpath(options) {
|
|
6
|
+
// eslint-disable-next-line new-cap
|
|
7
|
+
return (0, _jsonpathPlus.JSONPath)({
|
|
8
|
+
// Disable javascript evaluation by default
|
|
9
|
+
preventEval: true,
|
|
10
|
+
...options
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=jsonpath.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsonpath.js","names":["jsonpath","options","JSONPath","preventEval"],"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"],"mappings":";;;AAAA;AAEO,SAASA,QAAQ,CAACC,OAAwB,EAAO;EACtD;EACA,OAAO,IAAAC,sBAAQ,EAAC;IACd;IACHC,WAAW,EAAE,IAAI;IAAE,GAAGF;EAAS,CAAC,CAAC;AAClC"}
|