├── .watchmanconfig
├── samples
├── .eslintignore
├── generated
│ ├── static-spa
│ │ ├── .npmrc
│ │ ├── .eslintrc.js
│ │ └── package.json
│ ├── webpack-spa
│ │ ├── .eslintignore
│ │ ├── .npmrc
│ │ ├── .gitignore
│ │ ├── .eslintrc.js
│ │ └── package.json
│ ├── express-web-no-oidc
│ │ ├── .npmrc
│ │ ├── .eslintrc.js
│ │ └── package.json
│ ├── express-web-with-oidc
│ │ ├── .npmrc
│ │ ├── .eslintrc.js
│ │ └── package.json
│ ├── express-embedded-auth-with-sdk
│ │ ├── .npmrc
│ │ ├── web-server
│ │ │ ├── views
│ │ │ │ ├── nav.mustache
│ │ │ │ ├── cancel.mustache
│ │ │ │ ├── formMessages.mustache
│ │ │ │ ├── head.mustache
│ │ │ │ ├── errors.mustache
│ │ │ │ ├── terminal.mustache
│ │ │ │ ├── menu.mustache
│ │ │ │ ├── error.mustache
│ │ │ │ └── unlock-account.mustache
│ │ │ ├── assets
│ │ │ │ └── js
│ │ │ │ │ └── poll.js
│ │ │ └── utils
│ │ │ │ ├── sendJson.js
│ │ │ │ └── appendTransactionIdToPath.js
│ │ ├── .eslintrc.js
│ │ └── package.json
│ ├── express-embedded-sign-in-widget
│ │ ├── .npmrc
│ │ ├── web-server
│ │ │ ├── views
│ │ │ │ ├── nav.mustache
│ │ │ │ ├── head.mustache
│ │ │ │ ├── errors.mustache
│ │ │ │ ├── error.mustache
│ │ │ │ └── menu.mustache
│ │ │ ├── utils
│ │ │ │ ├── getTransactionMeta.js
│ │ │ │ └── index.js
│ │ │ └── middlewares
│ │ │ │ ├── oidcConfig.js
│ │ │ │ └── index.js
│ │ ├── .eslintrc.js
│ │ └── package.json
│ └── react-embedded-auth-with-sdk
│ │ ├── src
│ │ ├── main.css
│ │ ├── components
│ │ │ ├── TopNav
│ │ │ │ ├── TopNav.module.css
│ │ │ │ └── index.jsx
│ │ │ ├── Profile
│ │ │ │ └── index.jsx
│ │ │ ├── FlowPage
│ │ │ │ ├── index.jsx
│ │ │ │ └── FlowPage.module.css
│ │ │ ├── HomePage
│ │ │ │ ├── index.jsx
│ │ │ │ └── HomePage.module.css
│ │ │ ├── InfoBox
│ │ │ │ ├── index.jsx
│ │ │ │ ├── InfoBox.module.css
│ │ │ │ └── InfoBox.jsx
│ │ │ ├── LinkButton
│ │ │ │ ├── index.jsx
│ │ │ │ ├── LinkButton.module.css
│ │ │ │ └── LinkButton.jsx
│ │ │ ├── TransactionModalButton
│ │ │ │ └── index.jsx
│ │ │ ├── ErrorPage.jsx
│ │ │ ├── Spinner.jsx
│ │ │ ├── TerminalPage.jsx
│ │ │ ├── IdpForm.jsx
│ │ │ └── CanceledPage.jsx
│ │ ├── main.jsx
│ │ ├── contexts.js
│ │ ├── util.js
│ │ ├── .eslintrc.js
│ │ └── config.js
│ │ ├── .gitignore
│ │ └── index.html
├── templates
│ ├── static-spa
│ │ ├── .npmrc
│ │ ├── README.md
│ │ ├── .eslintrc.js
│ │ ├── package.json
│ │ └── public
│ │ │ └── app.js
│ ├── webpack-spa
│ │ ├── .eslintignore
│ │ ├── .npmrc
│ │ ├── README.md
│ │ ├── .gitignore
│ │ ├── public
│ │ │ └── index.html
│ │ ├── .eslintrc.js
│ │ ├── package.json
│ │ └── src
│ │ │ └── index.js
│ ├── express-web
│ │ ├── .npmrc
│ │ ├── README.md
│ │ ├── .eslintrc.js
│ │ └── package.json
│ ├── partials
│ │ ├── identity-engine
│ │ │ ├── links.md
│ │ │ └── custom-storage-provider.md
│ │ ├── env.js
│ │ └── spa
│ │ │ ├── util.js
│ │ │ └── authMethod
│ │ │ └── direct
│ │ │ └── factors
│ │ │ ├── okta_verify.js
│ │ │ └── email.js
│ ├── react-embedded-auth-with-sdk
│ │ └── env
│ │ │ └── index.js
│ ├── express-embedded-auth-with-sdk
│ │ └── env
│ │ │ └── index.js
│ └── express-embedded-sign-in-widget
│ │ ├── env
│ │ └── index.js
│ │ └── package.json
├── test
│ ├── support
│ │ ├── selectors
│ │ │ ├── maps
│ │ │ │ ├── links.ts
│ │ │ │ ├── inputs.ts
│ │ │ │ ├── buttons.ts
│ │ │ │ └── authenticators.ts
│ │ │ ├── types.ts
│ │ │ ├── Page.ts
│ │ │ ├── Nav.ts
│ │ │ ├── Unauth.ts
│ │ │ ├── VerifyEmail.ts
│ │ │ ├── PasswordSetup.ts
│ │ │ ├── EnrollEmailAuthenticator.ts
│ │ │ ├── ChallengeSecurityQuestion.ts
│ │ │ ├── ChallengeEmailAuthenticator.ts
│ │ │ ├── ChallengePasswordAuthenticator.ts
│ │ │ ├── ChallengePhoneAuthenticator.ts
│ │ │ └── ChallengeGoogleAuthenticator.ts
│ │ ├── action
│ │ │ ├── noop.ts
│ │ │ ├── clickButton.ts
│ │ │ ├── clickLoginWithFacebookInWidget.ts
│ │ │ ├── clickLoginWithOktaOIDCIdPInWidget.ts
│ │ │ ├── clickLink.ts
│ │ │ ├── enterValidPassword.ts
│ │ │ ├── confirmValidPassword.ts
│ │ │ ├── pressButton.ts
│ │ │ ├── skipForm.ts
│ │ │ ├── deleteCookies.ts
│ │ │ ├── enterIncorrectCredential.ts
│ │ │ ├── clickFacebookButton.ts
│ │ │ ├── clickOIDCIdPButton.ts
│ │ │ ├── context-enabled
│ │ │ │ └── live-user
│ │ │ │ │ ├── enterValidPassword.ts
│ │ │ │ │ ├── confirmValidPassword.ts
│ │ │ │ │ └── openEmailMagicLink.ts
│ │ │ ├── enterQuestionAnswer.ts
│ │ │ ├── inputInvalidEmailFormat.ts
│ │ │ ├── enterIncorrectPhoneNumberFormat.ts
│ │ │ ├── enterCustomQuestion.ts
│ │ │ ├── scroll.ts
│ │ │ ├── inputInvalidEmail.ts
│ │ │ ├── selectAuthenticator.ts
│ │ │ ├── clearInputField.ts
│ │ │ ├── getText.ts
│ │ │ ├── selectAuthenticatorMethod.ts
│ │ │ ├── selectSecurityQuestion.ts
│ │ │ └── getSecretFromSharedSecret.ts
│ │ ├── check
│ │ │ ├── checkLink.ts
│ │ │ ├── checkNoProfile.ts
│ │ │ ├── checkNoWidget.ts
│ │ │ ├── checkQuestionAnswerDisplayed.ts
│ │ │ ├── checkCustomSecurityQuestion.ts
│ │ │ └── checkSocialLoginButton.ts
│ │ ├── management-api
│ │ │ ├── createGroup.ts
│ │ │ ├── grantConsentToScope.ts
│ │ │ ├── fetchUser.ts
│ │ │ ├── fetchGroup.ts
│ │ │ ├── fetchPolicy.ts
│ │ │ ├── addAppToPolicy.ts
│ │ │ ├── addAppToGroup.ts
│ │ │ ├── util
│ │ │ │ └── getOktaClient.ts
│ │ │ ├── updateAppOAuthClient.ts
│ │ │ └── deleteUser.ts
│ │ └── wait
│ │ │ ├── waitForOneSecond.ts
│ │ │ └── waitForURLPath.ts
│ ├── .gitignore
│ ├── .babelrc
│ ├── util
│ │ ├── random.js
│ │ ├── selectorUtils.ts
│ │ ├── camelize.js
│ │ └── getTotp.js
│ ├── scripts
│ │ └── run.sh
│ ├── features
│ │ ├── federated-auth.feature
│ │ ├── self-service-registration-activation-token.feature
│ │ ├── social-idp-with-widget.feature
│ │ ├── social-login-mfa.feature
│ │ ├── social-idp.feature
│ │ └── self-service-registration-custom-attribute.feature
│ ├── pageobjects
│ │ └── EmbeddedAuthWithSDKApp.js
│ └── specs
│ │ └── express-embedded-auth-with-sdk.js
└── package.json
├── test
├── support
│ ├── .eslintignore
│ ├── disableFetch.js
│ ├── .eslintrc.json
│ ├── package.json
│ ├── jest
│ │ └── jest.config.unit.js
│ ├── idx
│ │ ├── index.ts
│ │ └── factories
│ │ │ └── index.ts
│ ├── xhr
│ │ ├── empty.js
│ │ ├── error-network.js
│ │ ├── cancel.js
│ │ ├── userinfo.js
│ │ ├── pkce-token-success.js
│ │ ├── error-userinfo-invalid-token.js
│ │ └── recovery-challenge-email.js
│ └── nodeExceptions.js
├── apps
│ ├── tree-shaking
│ │ ├── .gitignore
│ │ ├── src
│ │ │ ├── myaccount.js
│ │ │ ├── full.js
│ │ │ ├── core.js
│ │ │ └── authn.js
│ │ ├── package.json
│ │ └── README.md
│ ├── app
│ │ ├── .eslintignore
│ │ ├── .gitignore
│ │ ├── server
│ │ │ └── proxyMiddleware.js
│ │ ├── public
│ │ │ ├── renew
│ │ │ │ └── index.html
│ │ │ ├── protected
│ │ │ │ └── index.html
│ │ │ ├── login
│ │ │ │ └── callback
│ │ │ │ │ └── index.html
│ │ │ └── popup
│ │ │ │ └── callback
│ │ │ │ └── index.html
│ │ ├── tsconfig.json
│ │ └── src
│ │ │ ├── constants.ts
│ │ │ └── webpackEntry.ts
│ ├── verify-entries
│ │ ├── src
│ │ │ ├── vite-env.d.ts
│ │ │ ├── default.ts
│ │ │ ├── idx.ts
│ │ │ └── authn.ts
│ │ ├── idx.html
│ │ ├── authn.html
│ │ ├── default.html
│ │ ├── .gitignore
│ │ ├── tsconfig.json
│ │ ├── README.md
│ │ └── package.json
│ ├── react-mfa-v1
│ │ ├── README.md
│ │ ├── src
│ │ │ ├── OktaContext.js
│ │ │ ├── main.jsx
│ │ │ └── config.js
│ │ ├── .eslintrc.js
│ │ ├── index.html
│ │ └── .gitignore
│ └── node-esm
│ │ ├── index.js
│ │ └── package.json
├── e2e
│ ├── .gitignore
│ ├── .babelrc
│ ├── features
│ │ ├── login.feature
│ │ ├── .eslintrc.json
│ │ └── step-definitions
│ │ │ └── before.ts
│ ├── tsconfig.json
│ ├── specs
│ │ └── mfa.js
│ └── config.js
├── integration
│ ├── util
│ │ ├── sleep.ts
│ │ └── index.ts
│ └── spec
│ │ └── myaccount
│ │ └── __snapshots__
│ │ ├── sendRequest.ts.snap
│ │ └── profile.ts.snap
├── spec
│ ├── idx
│ │ └── idxState
│ │ │ └── mocks
│ │ │ ├── interact-response.json
│ │ │ ├── terminal-return-email.json
│ │ │ └── success.json
│ ├── tsconfig.spec.json
│ └── base
│ │ └── options.ts
├── types
│ ├── tstyche.config.json
│ ├── package.json
│ ├── README.md
│ ├── tsconfig.json
│ └── http.test-d.ts
├── .eslintrc.json
└── tsconfig.json
├── docs
├── .gitattributes
└── myaccount
│ └── enums
│ ├── Status.md
│ ├── EmailRole.md
│ └── PasswordStatus.md
├── lib
├── oidc
│ ├── options
│ │ ├── browser.ts
│ │ ├── index.ts
│ │ └── node.ts
│ ├── factory
│ │ └── index.ts
│ ├── util
│ │ ├── refreshToken.ts
│ │ ├── enrollAuthenticatorMeta.ts
│ │ └── validateToken.ts
│ ├── endpoints
│ │ └── index.ts
│ └── types
│ │ ├── TransactionManager.ts
│ │ └── endpoints.ts
├── browser
│ └── .eslintrc.json
├── idx
│ ├── remediators
│ │ ├── GenericRemediator
│ │ │ └── index.ts
│ │ ├── ReEnrollAuthenticatorWarning.ts
│ │ └── ChallengePoll.ts
│ ├── factory
│ │ └── index.ts
│ ├── types
│ │ ├── FlowSpecification.ts
│ │ └── FlowIdentifier.ts
│ ├── authenticator
│ │ ├── OktaVerifyTotp.ts
│ │ └── Authenticator.ts
│ ├── idxState
│ │ └── v1
│ │ │ └── parsers.ts
│ └── flow
│ │ ├── RemediationFlow.ts
│ │ └── index.ts
├── authn
│ └── index.ts
├── base
│ └── index.ts
├── core
│ ├── types
│ │ └── index.ts
│ ├── index.ts
│ ├── storage.ts
│ └── ServiceManager
│ │ └── index.ts
├── exports
│ ├── cdn
│ │ ├── core.ts
│ │ ├── idx.ts
│ │ ├── authn.ts
│ │ ├── default.ts
│ │ └── myaccount.ts
│ └── common.ts
├── session
│ ├── index.ts
│ ├── factory.ts
│ └── types.ts
├── crypto
│ ├── types.ts
│ ├── webcrypto.ts
│ ├── index.ts
│ └── browser.ts
├── http
│ ├── index.ts
│ └── headers.ts
├── storage
│ └── index.ts
├── myaccount
│ ├── transactions
│ │ ├── ProfileSchemaTransaction.ts
│ │ ├── ProfileTransaction.ts
│ │ ├── index.ts
│ │ └── EmailStatusTransaction.ts
│ ├── index.ts
│ └── api.ts
├── errors
│ ├── types.ts
│ └── AuthPollStopError.ts
├── types
│ └── global.d.ts
├── license-header.txt
├── .eslintrc.js
├── services
│ └── index.ts
└── util
│ ├── index.ts
│ └── jsonpath.ts
├── .npmignore
├── scripts
├── travis.sh
├── samples
│ ├── e2e-static-spa.sh
│ ├── e2e-webpack-spa.sh
│ ├── e2e-express-web-no-oidc.sh
│ ├── e2e-express-web-with-oidc.sh
│ ├── e2e-react-embedded-auth-with-sdk.sh
│ ├── e2e-express-embedded-sign-in-widget.sh
│ ├── e2e-express-embedded-auth-with-sdk-features.sh
│ └── e2e-express-embedded-auth-with-sdk-spec.sh
├── e2e
│ ├── e2e-cucumber.sh
│ ├── e2e-dpop.sh
│ ├── e2e.sh
│ ├── e2e-saucelabs.sh
│ └── e2e-mfa.sh
├── buildtools
│ ├── license-template
│ └── maintain-banners.js
├── verify-package.js
└── downstream
│ └── create-downstream-for-widget.sh
├── env
└── package.json
├── .github
├── ISSUE_TEMPLATE
│ └── config.yml
└── SECURITY.md
├── .travis.yml
├── .gitignore
├── .eslintignore
├── babel.config.js
├── _testenv.yml
├── jest.browser.js
├── babel.cjs.js
├── typedoc.js
└── webpack.polyfill.config.js
/.watchmanconfig:
--------------------------------------------------------------------------------
1 | {}
--------------------------------------------------------------------------------
/samples/.eslintignore:
--------------------------------------------------------------------------------
1 | /templates
--------------------------------------------------------------------------------
/test/support/.eslintignore:
--------------------------------------------------------------------------------
1 | xhr
2 |
--------------------------------------------------------------------------------
/test/apps/tree-shaking/.gitignore:
--------------------------------------------------------------------------------
1 | dist
2 |
--------------------------------------------------------------------------------
/test/apps/app/.eslintignore:
--------------------------------------------------------------------------------
1 | /public
2 | /target
--------------------------------------------------------------------------------
/samples/generated/static-spa/.npmrc:
--------------------------------------------------------------------------------
1 | engine-strict=true
--------------------------------------------------------------------------------
/samples/generated/webpack-spa/.eslintignore:
--------------------------------------------------------------------------------
1 | /public
--------------------------------------------------------------------------------
/samples/templates/static-spa/.npmrc:
--------------------------------------------------------------------------------
1 | engine-strict=true
--------------------------------------------------------------------------------
/samples/templates/webpack-spa/.eslintignore:
--------------------------------------------------------------------------------
1 | /public
--------------------------------------------------------------------------------
/test/e2e/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | .yalc
3 | *.log
--------------------------------------------------------------------------------
/docs/.gitattributes:
--------------------------------------------------------------------------------
1 | myaccount/**/* linguist-generated=true
--------------------------------------------------------------------------------
/samples/generated/webpack-spa/.npmrc:
--------------------------------------------------------------------------------
1 | engine-strict=true
--------------------------------------------------------------------------------
/samples/templates/express-web/.npmrc:
--------------------------------------------------------------------------------
1 | engine-strict=true
--------------------------------------------------------------------------------
/samples/templates/webpack-spa/.npmrc:
--------------------------------------------------------------------------------
1 | engine-strict=true
--------------------------------------------------------------------------------
/samples/generated/express-web-no-oidc/.npmrc:
--------------------------------------------------------------------------------
1 | engine-strict=true
--------------------------------------------------------------------------------
/samples/templates/static-spa/README.md:
--------------------------------------------------------------------------------
1 | {{> spa/README.md }}
2 |
--------------------------------------------------------------------------------
/samples/generated/express-web-with-oidc/.npmrc:
--------------------------------------------------------------------------------
1 | engine-strict=true
--------------------------------------------------------------------------------
/samples/templates/express-web/README.md:
--------------------------------------------------------------------------------
1 | {{> web/README.md }}
2 |
--------------------------------------------------------------------------------
/samples/templates/webpack-spa/README.md:
--------------------------------------------------------------------------------
1 | {{> spa/README.md }}
2 |
--------------------------------------------------------------------------------
/samples/test/support/selectors/maps/links.ts:
--------------------------------------------------------------------------------
1 | export default {};
2 |
--------------------------------------------------------------------------------
/lib/oidc/options/browser.ts:
--------------------------------------------------------------------------------
1 | export const enableSharedStorage = true;
2 |
--------------------------------------------------------------------------------
/lib/oidc/options/index.ts:
--------------------------------------------------------------------------------
1 | export * from './OAuthOptionsConstructor';
2 |
--------------------------------------------------------------------------------
/samples/generated/express-embedded-auth-with-sdk/.npmrc:
--------------------------------------------------------------------------------
1 | engine-strict=true
--------------------------------------------------------------------------------
/samples/test/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | .yalc
3 | *.log
4 | reports
5 |
--------------------------------------------------------------------------------
/lib/oidc/options/node.ts:
--------------------------------------------------------------------------------
1 |
2 | export const enableSharedStorage = false;
3 |
--------------------------------------------------------------------------------
/samples/generated/express-embedded-sign-in-widget/.npmrc:
--------------------------------------------------------------------------------
1 | engine-strict=true
--------------------------------------------------------------------------------
/lib/browser/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "env": {
3 | "browser": true
4 | }
5 | }
--------------------------------------------------------------------------------
/lib/idx/remediators/GenericRemediator/index.ts:
--------------------------------------------------------------------------------
1 | export * from './GenericRemediator';
--------------------------------------------------------------------------------
/samples/generated/react-embedded-auth-with-sdk/src/main.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | }
--------------------------------------------------------------------------------
/test/apps/verify-entries/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/lib/oidc/factory/index.ts:
--------------------------------------------------------------------------------
1 | export * from './api';
2 | export * from './OktaAuthOAuth';
3 |
--------------------------------------------------------------------------------
/samples/generated/webpack-spa/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | public/*.js
3 | public/*.map
4 |
--------------------------------------------------------------------------------
/samples/templates/webpack-spa/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | public/*.js
3 | public/*.map
4 |
--------------------------------------------------------------------------------
/lib/authn/index.ts:
--------------------------------------------------------------------------------
1 | export * from './factory';
2 | export * from './mixin';
3 | export * from './types';
4 |
--------------------------------------------------------------------------------
/lib/base/index.ts:
--------------------------------------------------------------------------------
1 | export * from './factory';
2 | export * from './options';
3 | export * from './types';
4 |
--------------------------------------------------------------------------------
/test/apps/app/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | .yalc
3 | *.log
4 | public/*.js
5 | public/*.map
6 | public/dist/*
7 |
--------------------------------------------------------------------------------
/test/apps/react-mfa-v1/README.md:
--------------------------------------------------------------------------------
1 | # React AuthN MFA Test app
2 |
3 | SPA test app to verify AuthN MFA flows
4 |
--------------------------------------------------------------------------------
/test/integration/util/sleep.ts:
--------------------------------------------------------------------------------
1 | export const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms));
2 |
--------------------------------------------------------------------------------
/lib/core/types/index.ts:
--------------------------------------------------------------------------------
1 | export * from './api';
2 | export * from './AuthState';
3 | export * from './Service';
4 |
--------------------------------------------------------------------------------
/test/spec/idx/idxState/mocks/interact-response.json:
--------------------------------------------------------------------------------
1 | {
2 | "interaction_handle": "ZZZZZZZINTERACTZZZZZZZZ"
3 | }
4 |
--------------------------------------------------------------------------------
/samples/generated/express-embedded-auth-with-sdk/web-server/views/nav.mustache:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/samples/generated/express-embedded-sign-in-widget/web-server/views/nav.mustache:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test/apps/react-mfa-v1/src/OktaContext.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 |
3 | export default React.createContext(null);
4 |
--------------------------------------------------------------------------------
/test/integration/util/index.ts:
--------------------------------------------------------------------------------
1 | export * from './createClient';
2 | export * from './getTokens';
3 | export * from './sleep';
--------------------------------------------------------------------------------
/lib/idx/factory/index.ts:
--------------------------------------------------------------------------------
1 | export * from './api';
2 | export * from './OktaAuthIdx';
3 | export * from './MinimalOktaAuthIdx';
4 |
--------------------------------------------------------------------------------
/samples/generated/react-embedded-auth-with-sdk/src/components/TopNav/TopNav.module.css:
--------------------------------------------------------------------------------
1 | .container {
2 | height: 4em;
3 | }
4 |
--------------------------------------------------------------------------------
/samples/test/support/action/noop.ts:
--------------------------------------------------------------------------------
1 | /* eslint-disable @typescript-eslint/no-empty-function */
2 | export default () => {};
3 |
--------------------------------------------------------------------------------
/.npmignore:
--------------------------------------------------------------------------------
1 | test
2 | build2
3 | .eslintrc.json
4 | .eslintignore
5 | .travis.yml
6 | ci-scripts
7 | webpack*config.js
8 | scripts
9 |
--------------------------------------------------------------------------------
/lib/exports/cdn/core.ts:
--------------------------------------------------------------------------------
1 | import { OktaAuth } from '../core';
2 |
3 | // Export only a single object
4 | export default OktaAuth;
5 |
--------------------------------------------------------------------------------
/lib/exports/cdn/idx.ts:
--------------------------------------------------------------------------------
1 | import { OktaAuth } from '../idx';
2 |
3 | // Export only a single object
4 | export default OktaAuth;
5 |
--------------------------------------------------------------------------------
/test/apps/react-mfa-v1/.eslintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | root: true,
3 | ignorePatterns: ['**/*.js', '**/*.jsx'],
4 | };
5 |
--------------------------------------------------------------------------------
/test/e2e/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": ["@babel/preset-env"],
3 | "plugins": ["@babel/plugin-transform-async-to-generator"]
4 | }
5 |
--------------------------------------------------------------------------------
/test/spec/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "noEmit": true
5 | }
6 | }
--------------------------------------------------------------------------------
/test/types/tstyche.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://tstyche.org/schemas/config.json",
3 | "testFileMatch": ["./*-d.ts"]
4 | }
--------------------------------------------------------------------------------
/lib/exports/cdn/authn.ts:
--------------------------------------------------------------------------------
1 | import { OktaAuth } from '../authn';
2 |
3 | // Export only a single object
4 | export default OktaAuth;
5 |
--------------------------------------------------------------------------------
/lib/exports/cdn/default.ts:
--------------------------------------------------------------------------------
1 | import { OktaAuth } from '../default';
2 |
3 | // Export only a single object
4 | export default OktaAuth;
5 |
--------------------------------------------------------------------------------
/lib/session/index.ts:
--------------------------------------------------------------------------------
1 | export * from './api';
2 | export * from './factory';
3 | export * from './mixin';
4 | export * from './types';
5 |
--------------------------------------------------------------------------------
/samples/generated/react-embedded-auth-with-sdk/src/components/Profile/index.jsx:
--------------------------------------------------------------------------------
1 | import Main from './Main';
2 | export default Main;
3 |
--------------------------------------------------------------------------------
/samples/test/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": ["@babel/preset-env"],
3 | "plugins": ["@babel/plugin-transform-async-to-generator"]
4 | }
5 |
--------------------------------------------------------------------------------
/lib/exports/cdn/myaccount.ts:
--------------------------------------------------------------------------------
1 | import { OktaAuth } from '../myaccount';
2 |
3 | // Export only a single object
4 | export default OktaAuth;
5 |
--------------------------------------------------------------------------------
/samples/generated/react-embedded-auth-with-sdk/src/components/TopNav/index.jsx:
--------------------------------------------------------------------------------
1 | import TopNav from './TopNav';
2 | export default TopNav;
3 |
--------------------------------------------------------------------------------
/samples/test/util/random.js:
--------------------------------------------------------------------------------
1 | import crypto from 'crypto';
2 |
3 | export const randomStr = len => crypto.randomBytes(len).toString('hex');
4 |
--------------------------------------------------------------------------------
/samples/generated/react-embedded-auth-with-sdk/src/components/FlowPage/index.jsx:
--------------------------------------------------------------------------------
1 | import FlowPage from './FlowPage';
2 | export default FlowPage;
3 |
--------------------------------------------------------------------------------
/samples/generated/react-embedded-auth-with-sdk/src/components/HomePage/index.jsx:
--------------------------------------------------------------------------------
1 | import HomePage from './HomePage';
2 | export default HomePage;
3 |
--------------------------------------------------------------------------------
/samples/generated/react-embedded-auth-with-sdk/src/components/InfoBox/index.jsx:
--------------------------------------------------------------------------------
1 | import InfoBox from './InfoBox';
2 | export default InfoBox;
3 |
--------------------------------------------------------------------------------
/samples/test/support/selectors/types.ts:
--------------------------------------------------------------------------------
1 | export interface Selectors {
2 | username: string;
3 | password: string;
4 | submit: string;
5 | }
6 |
--------------------------------------------------------------------------------
/samples/generated/react-embedded-auth-with-sdk/src/components/LinkButton/index.jsx:
--------------------------------------------------------------------------------
1 | import LinkButton from './LinkButton';
2 | export default LinkButton;
3 |
--------------------------------------------------------------------------------
/scripts/travis.sh:
--------------------------------------------------------------------------------
1 | set -e
2 |
3 | # run the validate and unit tests
4 | # validate will run lint and typescript build
5 | yarn validate
6 | yarn test:unit
7 |
--------------------------------------------------------------------------------
/lib/crypto/types.ts:
--------------------------------------------------------------------------------
1 | export interface CryptoAPI {
2 | base64UrlToBuffer(b64u: string): Uint8Array;
3 | bufferToBase64Url(bin: Uint8Array): string;
4 | }
5 |
--------------------------------------------------------------------------------
/samples/generated/react-embedded-auth-with-sdk/src/components/HomePage/HomePage.module.css:
--------------------------------------------------------------------------------
1 | .homePageContainer aside[role="status"] {
2 | max-width: none;
3 | }
--------------------------------------------------------------------------------
/samples/generated/react-embedded-auth-with-sdk/src/components/LinkButton/LinkButton.module.css:
--------------------------------------------------------------------------------
1 | .container a {
2 | font-weight: 600;
3 | cursor: default;
4 | }
5 |
--------------------------------------------------------------------------------
/samples/test/support/selectors/maps/inputs.ts:
--------------------------------------------------------------------------------
1 | export default {
2 | username: ['username', 'identifier'],
3 | password: ['password', 'credentials.passcode'],
4 | };
5 |
--------------------------------------------------------------------------------
/test/apps/tree-shaking/src/myaccount.js:
--------------------------------------------------------------------------------
1 | /* eslint-disable */
2 | import * as myaccount from '@okta/okta-auth-js/myaccount';
3 |
4 | console.log(Object.keys(myaccount));
5 |
--------------------------------------------------------------------------------
/samples/test/support/selectors/maps/buttons.ts:
--------------------------------------------------------------------------------
1 | export default {
2 | login: ['signin', 'login'],
3 | register: ['signup', 'register'],
4 | logout: ['signout', 'logout']
5 | };
6 |
--------------------------------------------------------------------------------
/test/types/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@okta/test.types",
3 | "version": "1.0.0",
4 | "description": "test type declarations",
5 | "scripts": {
6 | "test": "tstyche"
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/env/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@okta/env",
3 | "version": "1.0.0",
4 | "main": "index.js",
5 | "private": true,
6 | "dependencies": {
7 | "dotenv": "^8.2.0"
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/samples/generated/react-embedded-auth-with-sdk/src/components/TransactionModalButton/index.jsx:
--------------------------------------------------------------------------------
1 | import TransactionModalButton from './TransactionModalButton';
2 | export default TransactionModalButton;
3 |
--------------------------------------------------------------------------------
/lib/http/index.ts:
--------------------------------------------------------------------------------
1 | export * from './headers';
2 | export * from './OktaUserAgent';
3 | export * from './request';
4 | export * from './types';
5 | export * from './mixin';
6 | export * from './options';
7 |
8 |
--------------------------------------------------------------------------------
/lib/storage/index.ts:
--------------------------------------------------------------------------------
1 | export * from './options/StorageOptionsConstructor';
2 | export * from './BaseStorageManager';
3 | export * from './mixin';
4 | export * from './SavedObject';
5 | export * from './types';
6 |
--------------------------------------------------------------------------------
/test/support/disableFetch.js:
--------------------------------------------------------------------------------
1 | // Throw an error if any test tries to make a live network request
2 | global.fetch = function(url) {
3 | throw new Error(`Attempt to make a live network request: ${url}`);
4 | };
5 |
--------------------------------------------------------------------------------
/samples/generated/static-spa/.eslintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | env: {
3 | browser: true,
4 | node: false
5 | },
6 | rules: {
7 | 'node/no-unsupported-features/node-builtins': 0
8 | }
9 | };
10 |
--------------------------------------------------------------------------------
/samples/templates/static-spa/.eslintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | env: {
3 | browser: true,
4 | node: false
5 | },
6 | rules: {
7 | 'node/no-unsupported-features/node-builtins': 0
8 | }
9 | };
10 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/config.yml:
--------------------------------------------------------------------------------
1 | contact_links:
2 | - name: Developer Forum
3 | url: https://devforum.okta.com/
4 | about: Get help with building your applicaiton on the Okta Platform.
5 | blank_issues_enabled: false
6 |
--------------------------------------------------------------------------------
/scripts/samples/e2e-static-spa.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | source $(dirname "${BASH_SOURCE[0]}")/../setup-e2e.sh
4 |
5 | setup_sample_tests
6 |
7 | export SAMPLE_NAME=@okta/samples.static-spa
8 |
9 | run_sample_tests
10 |
--------------------------------------------------------------------------------
/scripts/samples/e2e-webpack-spa.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | source $(dirname "${BASH_SOURCE[0]}")/../setup-e2e.sh
4 |
5 | setup_sample_tests
6 |
7 | export SAMPLE_NAME=@okta/samples.webpack-spa
8 |
9 | run_sample_tests
10 |
--------------------------------------------------------------------------------
/test/apps/node-esm/index.js:
--------------------------------------------------------------------------------
1 | /* eslint-disable */
2 | import { OktaAuth } from "@okta/okta-auth-js";
3 |
4 | const oktaAuth = new OktaAuth({
5 | issuer: 'https://xxx.okta.com',
6 | clientId: '0oal89rzfrHjIVqQw5d6'
7 | });
8 |
--------------------------------------------------------------------------------
/test/apps/tree-shaking/src/full.js:
--------------------------------------------------------------------------------
1 | /* eslint-disable */
2 | import { OktaAuth } from '@okta/okta-auth-js';
3 |
4 | const oktaAuth = new OktaAuth({
5 | issuer: 'https://xxx.okta.com',
6 | clientId: '0oal89rzfrHjIVqQw5d6'
7 | });
8 |
--------------------------------------------------------------------------------
/samples/generated/react-embedded-auth-with-sdk/src/components/FlowPage/FlowPage.module.css:
--------------------------------------------------------------------------------
1 | .container {
2 | height: 100vh;
3 | }
4 |
5 | .nav {
6 | height: 4em;
7 | }
8 |
9 | .formContainer {
10 | width: 400px;
11 | }
12 |
--------------------------------------------------------------------------------
/test/apps/tree-shaking/src/core.js:
--------------------------------------------------------------------------------
1 | /* eslint-disable */
2 | import { OktaAuth } from '@okta/okta-auth-js/core';
3 |
4 | const oktaAuth = new OktaAuth({
5 | issuer: 'https://xxx.okta.com',
6 | clientId: '0oal89rzfrHjIVqQw5d6'
7 | });
8 |
--------------------------------------------------------------------------------
/lib/core/index.ts:
--------------------------------------------------------------------------------
1 | export * from './AuthStateManager';
2 | export * from './options';
3 | export * from './factory';
4 | export * from './mixin';
5 | export * from './storage';
6 | export * from './types';
7 | export * from './ServiceManager';
8 |
--------------------------------------------------------------------------------
/scripts/samples/e2e-express-web-no-oidc.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | source $(dirname "${BASH_SOURCE[0]}")/../setup-e2e.sh
4 |
5 | setup_sample_tests
6 |
7 | export SAMPLE_NAME=@okta/samples.express-web-no-oidc
8 |
9 | run_sample_tests
10 |
--------------------------------------------------------------------------------
/test/apps/verify-entries/src/default.ts:
--------------------------------------------------------------------------------
1 | import { OktaAuth } from '@okta/okta-auth-js';
2 |
3 | const authClient = new OktaAuth({
4 | issuer: process.env.ISSUER,
5 | clientId: process.env.SPA_CLIENT_ID,
6 | });
7 | console.log(authClient);
8 |
--------------------------------------------------------------------------------
/samples/generated/express-embedded-auth-with-sdk/web-server/views/cancel.mustache:
--------------------------------------------------------------------------------
1 |
6 |
--------------------------------------------------------------------------------
/scripts/samples/e2e-express-web-with-oidc.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | source $(dirname "${BASH_SOURCE[0]}")/../setup-e2e.sh
4 |
5 | setup_sample_tests
6 |
7 | export SAMPLE_NAME=@okta/samples.express-web-with-oidc
8 |
9 | run_sample_tests
10 |
--------------------------------------------------------------------------------
/scripts/e2e/e2e-cucumber.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | source $(dirname "${BASH_SOURCE[0]}")/../setup-e2e.sh
4 |
5 | setup_sample_tests
6 |
7 | export TEST_NAME=e2e
8 |
9 | export ORG_OIE_ENABLED=true
10 |
11 | export RUN_CUCUMBER=1
12 |
13 | run_e2e
14 |
--------------------------------------------------------------------------------
/samples/test/util/selectorUtils.ts:
--------------------------------------------------------------------------------
1 | import { OktaSignInV1, OktaSignInOIE } from '../support/selectors';
2 |
3 | function getOktaSignInForm() {
4 | return process.env.ORG_OIE_ENABLED ? OktaSignInOIE : OktaSignInV1;
5 | }
6 |
7 | export { getOktaSignInForm };
8 |
--------------------------------------------------------------------------------
/scripts/samples/e2e-react-embedded-auth-with-sdk.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | source $(dirname "${BASH_SOURCE[0]}")/../setup-e2e.sh
4 |
5 | setup_sample_tests
6 |
7 | export SAMPLE_NAME=@okta/samples.react-embedded-auth-with-sdk
8 |
9 | run_sample_tests
10 |
--------------------------------------------------------------------------------
/test/apps/verify-entries/src/idx.ts:
--------------------------------------------------------------------------------
1 | import { OktaAuth } from '@okta/okta-auth-js/idx';
2 |
3 | const authClient = new OktaAuth({
4 | issuer: process.env.ISSUER,
5 | clientId: process.env.SPA_CLIENT_ID,
6 | });
7 | authClient.idx.start().then(console.log);
8 |
--------------------------------------------------------------------------------
/scripts/samples/e2e-express-embedded-sign-in-widget.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | source $(dirname "${BASH_SOURCE[0]}")/../setup-e2e.sh
4 |
5 | setup_sample_tests
6 |
7 | export SAMPLE_NAME=@okta/samples.express-embedded-sign-in-widget
8 |
9 | run_sample_tests
10 |
--------------------------------------------------------------------------------
/.github/SECURITY.md:
--------------------------------------------------------------------------------
1 | # Security Policy
2 |
3 | ## Report a Vulnerability
4 | At Okta we take the protection of our customers’ data very seriously. If you need to report a vulnerability, please visit https://www.okta.com/vulnerability-reporting-policy/ for more information.
5 |
--------------------------------------------------------------------------------
/samples/test/support/action/clickButton.ts:
--------------------------------------------------------------------------------
1 | import checkButton from '../check/checkButton';
2 |
3 | export default async (buttonName: string, containerSelector?: string) => {
4 | const el = await checkButton(buttonName, containerSelector);
5 | await el.click();
6 | };
7 |
--------------------------------------------------------------------------------
/samples/templates/partials/identity-engine/links.md:
--------------------------------------------------------------------------------
1 | [Okta's Identity Engine]: https://developer.okta.com/docs/concepts/ie-intro/
2 | [Okta Auth JS]: https://github.com/okta/okta-auth-js
3 | {{! [ExpressJS guides for Embedded Authentication]: // TODO link to DevDoc SBS guide }}
4 |
--------------------------------------------------------------------------------
/test/apps/node-esm/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "private": true,
3 | "name": "@okta/test.app.node-esm",
4 | "version": "1.0.0",
5 | "type": "module",
6 | "scripts": {
7 | "start": "node index.js"
8 | },
9 | "dependencies": {
10 | "@okta/okta-auth-js": "*"
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/lib/core/storage.ts:
--------------------------------------------------------------------------------
1 | import { createOAuthStorageManager } from '../oidc/storage';
2 | import { PKCETransactionMeta } from '../oidc/types';
3 |
4 | export function createCoreStorageManager() {
5 | return createOAuthStorageManager();
6 | }
7 |
--------------------------------------------------------------------------------
/samples/generated/react-embedded-auth-with-sdk/src/components/InfoBox/InfoBox.module.css:
--------------------------------------------------------------------------------
1 | .container {
2 | overflow: hidden;
3 | word-wrap: break-word;
4 | border-style: dashed;
5 | color: #8d6e97;
6 | }
7 |
8 | .container h1,
9 | .container span{
10 | color: #8d6e97;
11 | }
12 |
--------------------------------------------------------------------------------
/test/types/README.md:
--------------------------------------------------------------------------------
1 | **Note:** All tests in this directory are running against types within 'build' folder, types should be generated before running test here.
2 |
3 | Script to generate types:
4 |
5 | ```bash
6 | yarn build
7 | ```
8 |
9 | or
10 |
11 | ```bash
12 | yarn build:types
13 | ```
14 |
--------------------------------------------------------------------------------
/samples/generated/express-embedded-auth-with-sdk/web-server/views/formMessages.mustache:
--------------------------------------------------------------------------------
1 | {{#hasMessages}}
2 |
9 | {{/hasMessages}}
--------------------------------------------------------------------------------
/samples/generated/express-embedded-auth-with-sdk/web-server/views/head.mustache:
--------------------------------------------------------------------------------
1 |
2 | Express Sample App
3 |
4 |
5 |
--------------------------------------------------------------------------------
/samples/generated/express-embedded-sign-in-widget/web-server/views/head.mustache:
--------------------------------------------------------------------------------
1 |
2 | Express Sample App
3 |
4 |
5 |
--------------------------------------------------------------------------------
/samples/generated/express-embedded-auth-with-sdk/web-server/views/errors.mustache:
--------------------------------------------------------------------------------
1 | {{#hasError}}
2 |
3 |
4 |
5 | {{#errors}}
6 | - {{.}}
7 | {{/errors}}
8 |
9 |
10 | {{/hasError}}
--------------------------------------------------------------------------------
/samples/generated/express-embedded-sign-in-widget/web-server/views/errors.mustache:
--------------------------------------------------------------------------------
1 | {{#hasError}}
2 |
3 |
4 |
5 | {{#errors}}
6 | - {{.}}
7 | {{/errors}}
8 |
9 |
10 | {{/hasError}}
--------------------------------------------------------------------------------
/samples/test/support/action/clickLoginWithFacebookInWidget.ts:
--------------------------------------------------------------------------------
1 | import clickElement from './clickElement';
2 | import { getOktaSignInForm } from '../../util';
3 |
4 | export default async () => {
5 | const OktaSignIn = getOktaSignInForm();
6 | await clickElement('click', 'selector', OktaSignIn.signinWithFacebookBtn);
7 | };
8 |
--------------------------------------------------------------------------------
/samples/test/scripts/run.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash -x
2 |
3 | # Test specs/*
4 | if ! yarn test:specs; then
5 | echo "Specs tests failed! Exiting..."
6 | exit ${TEST_FAILURE}
7 | fi
8 |
9 | # Test features/*
10 | if ! yarn test:features; then
11 | echo "Features tests failed! Exiting..."
12 | exit ${TEST_FAILURE}
13 | fi
14 |
--------------------------------------------------------------------------------
/lib/idx/types/FlowSpecification.ts:
--------------------------------------------------------------------------------
1 | import { FlowIdentifier } from './FlowIdentifier';
2 | import type { RemediationFlow } from '../flow/RemediationFlow';
3 |
4 | export interface FlowSpecification {
5 | flow: FlowIdentifier;
6 | remediators: RemediationFlow;
7 | actions?: string[];
8 | withCredentials?: boolean;
9 | }
10 |
--------------------------------------------------------------------------------
/samples/generated/react-embedded-auth-with-sdk/src/main.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom';
3 | import App from './App';
4 |
5 | import './main.css';
6 |
7 | ReactDOM.render(
8 |
9 |
10 | ,
11 | document.getElementById('root')
12 | );
13 |
--------------------------------------------------------------------------------
/samples/test/support/action/clickLoginWithOktaOIDCIdPInWidget.ts:
--------------------------------------------------------------------------------
1 | import clickElement from './clickElement';
2 | import { getOktaSignInForm } from '../../util';
3 |
4 | export default async () => {
5 | const OktaSignIn = getOktaSignInForm();
6 | await clickElement('click', 'selector', OktaSignIn.signinWithOktaOIDCIdPBtn);
7 | };
8 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: node_js
2 |
3 | node_js:
4 | - '14'
5 |
6 | install:
7 | - yarn install --frozen-lockfile
8 | - npm install -g codecov
9 |
10 | script:
11 | - ./scripts/travis.sh
12 |
13 | after_success:
14 | - bash <(curl -s https://codecov.io/bash)
15 |
16 | cache: false
17 |
18 | addons:
19 | chrome: stable
20 |
--------------------------------------------------------------------------------
/samples/generated/react-embedded-auth-with-sdk/src/components/ErrorPage.jsx:
--------------------------------------------------------------------------------
1 | import { useIdxTransaction } from '../contexts';
2 |
3 | export default function ErroPage() {
4 | const {
5 | transaction: { error }
6 | } = useIdxTransaction();
7 |
8 | return ({error.message || JSON.stringify(error, null, 4)}
);
9 | }
10 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | build
3 | target
4 | node_modules
5 | build2/reports/*
6 | !build2/reports/e2e
7 | build2/reports/e2e/*
8 | !build2/reports/e2e/.gitkeep
9 | test/SpecRunner.html
10 | npm-debug.log
11 | testenv
12 | testenv.yml
13 | junit.xml
14 | junit-results.xml
15 | yarn-error.*
16 | coverage
17 | dist
18 | .bacon.env
19 |
20 | !.gitkeep
21 |
--------------------------------------------------------------------------------
/test/apps/verify-entries/src/authn.ts:
--------------------------------------------------------------------------------
1 | import { OktaAuth } from '@okta/okta-auth-js/authn';
2 |
3 | const authClient = new OktaAuth({
4 | issuer: process.env.ISSUER,
5 | clientId: process.env.SPA_CLIENT_ID,
6 | });
7 | authClient.signInWithCredentials({
8 | username: 'fake-username',
9 | password: 'fake-password',
10 | }).then(console.log);
11 |
--------------------------------------------------------------------------------
/samples/templates/express-web/.eslintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | env: {
3 | browser: false,
4 | node: true
5 | },
6 | overrides: [{
7 | files: ['public/*.js'],
8 | rules: {
9 | 'node/no-unsupported-features/node-builtins': 0
10 | },
11 | env: {
12 | browser: true,
13 | node: false
14 | }
15 | }]
16 | };
17 |
--------------------------------------------------------------------------------
/samples/test/support/selectors/maps/authenticators.ts:
--------------------------------------------------------------------------------
1 | export default {
2 | 'Email': 'okta_email',
3 | 'Password': 'okta_password',
4 | 'Phone': 'phone_number',
5 | 'Google Authenticator': 'google_otp',
6 | 'Security Question': 'security_question',
7 | 'Okta Verify': 'okta_verify',
8 | 'WebAuthn': 'webauthn',
9 | } as Record;
10 |
--------------------------------------------------------------------------------
/test/apps/tree-shaking/src/authn.js:
--------------------------------------------------------------------------------
1 | /* eslint-disable */
2 | import { OktaAuth } from '@okta/okta-auth-js/core';
3 | import { useAuthnTransactionAPI } from '@okta/okta-auth-js/authn';
4 |
5 | let oktaAuth = new OktaAuth({
6 | issuer: 'https://xxx.okta.com',
7 | clientId: '0oal89rzfrHjIVqQw5d6'
8 | });
9 | oktaAuth = useAuthnTransactionAPI(oktaAuth);
10 |
--------------------------------------------------------------------------------
/lib/exports/common.ts:
--------------------------------------------------------------------------------
1 | import * as crypto from '../crypto';
2 |
3 | export { crypto };
4 | export * from '../base';
5 | export * from '../constants';
6 | export * from '../core';
7 | export * from '../errors';
8 | export * from '../http';
9 | export * from '../oidc';
10 | export * from '../session';
11 | export * from '../storage';
12 | export * from '../util';
13 |
--------------------------------------------------------------------------------
/lib/myaccount/transactions/ProfileSchemaTransaction.ts:
--------------------------------------------------------------------------------
1 | import BaseTransaction from './Base';
2 |
3 | export default class ProfileSchemaTransaction extends BaseTransaction {
4 | properties: Record;
5 |
6 | constructor(oktaAuth, options) {
7 | super(oktaAuth, options);
8 |
9 | this.properties = options.res.properties;
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/samples/generated/express-web-no-oidc/.eslintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | env: {
3 | browser: false,
4 | node: true
5 | },
6 | overrides: [{
7 | files: ['public/*.js'],
8 | rules: {
9 | 'node/no-unsupported-features/node-builtins': 0
10 | },
11 | env: {
12 | browser: true,
13 | node: false
14 | }
15 | }]
16 | };
17 |
--------------------------------------------------------------------------------
/samples/generated/express-web-with-oidc/.eslintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | env: {
3 | browser: false,
4 | node: true
5 | },
6 | overrides: [{
7 | files: ['public/*.js'],
8 | rules: {
9 | 'node/no-unsupported-features/node-builtins': 0
10 | },
11 | env: {
12 | browser: true,
13 | node: false
14 | }
15 | }]
16 | };
17 |
--------------------------------------------------------------------------------
/samples/generated/react-embedded-auth-with-sdk/src/contexts.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 |
3 | export const IdxTransaction = React.createContext({});
4 | export const useIdxTransaction = () => React.useContext(IdxTransaction);
5 |
6 | export const MyAccountContext = React.createContext({});
7 | export const useMyAccountContext = () => React.useContext(MyAccountContext);
8 |
--------------------------------------------------------------------------------
/test/apps/react-mfa-v1/src/main.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom';
3 | import { BrowserRouter as Router } from 'react-router-dom';
4 | import App from './App';
5 |
6 | ReactDOM.render(
7 |
8 |
9 |
10 |
11 | ,
12 | document.getElementById('root')
13 | );
14 |
--------------------------------------------------------------------------------
/test/apps/verify-entries/idx.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Vite + TS
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/lib/errors/types.ts:
--------------------------------------------------------------------------------
1 | export interface FieldError {
2 | errorSummary: string;
3 | reason?: string;
4 | location?: string;
5 | locationType?: string;
6 | domain?: string;
7 | }
8 |
9 | export interface APIError {
10 | errorSummary: string;
11 | errorCode?: string;
12 | errorLink?: string;
13 | errorId?: string;
14 | errorCauses?: Array;
15 | }
16 |
--------------------------------------------------------------------------------
/samples/generated/express-embedded-sign-in-widget/.eslintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | env: {
3 | browser: false,
4 | node: true
5 | },
6 | overrides: [{
7 | files: ['public/*.js'],
8 | rules: {
9 | 'node/no-unsupported-features/node-builtins': 0
10 | },
11 | env: {
12 | browser: true,
13 | node: false
14 | }
15 | }]
16 | };
17 |
--------------------------------------------------------------------------------
/samples/generated/react-embedded-auth-with-sdk/src/components/Spinner.jsx:
--------------------------------------------------------------------------------
1 | import { Box, CircularLoadIndicator } from '@okta/odyssey-react';
2 |
3 | const Spinner = () => (
4 |
5 |
6 |
7 | );
8 |
9 | export default Spinner;
10 |
--------------------------------------------------------------------------------
/test/apps/react-mfa-v1/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | React App
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/test/apps/verify-entries/authn.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Vite + TS
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/lib/idx/types/FlowIdentifier.ts:
--------------------------------------------------------------------------------
1 | export type FlowIdentifier = 'default'
2 | | 'proceed'
3 | // idx.authenticate
4 | | 'authenticate'
5 | | 'login'
6 | | 'signin'
7 | // idx.register
8 | | 'register'
9 | | 'signup'
10 | | 'enrollProfile'
11 | // idx.recoverPassword
12 | | 'recoverPassword'
13 | | 'resetPassword'
14 | // idx.unlockAccount
15 | | 'unlockAccount';
16 |
--------------------------------------------------------------------------------
/test/apps/app/server/proxyMiddleware.js:
--------------------------------------------------------------------------------
1 | const { createProxyMiddleware } = require('http-proxy-middleware');
2 |
3 | module.exports = function proxyMiddlewareFactory(options) {
4 | const { origin } = new URL(process.env.ISSUER);
5 | return createProxyMiddleware(Object.assign({
6 | target: origin,
7 | secure: false,
8 | changeOrigin: true,
9 | }, options));
10 | };
11 |
--------------------------------------------------------------------------------
/test/apps/verify-entries/default.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Vite + TS
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/samples/test/util/camelize.js:
--------------------------------------------------------------------------------
1 | // from https://stackoverflow.com/a/2970667
2 | export default function camelize(str) {
3 | return str.replace(/(?:^\w|[A-Z]|\b\w|\s+)/g, function(match, index) {
4 | if (+match === 0) {
5 | return ''; // or if (/\s+/.test(match)) for white spaces
6 | }
7 | return index === 0 ? match.toLowerCase() : match.toUpperCase();
8 | });
9 | }
10 |
--------------------------------------------------------------------------------
/samples/generated/react-embedded-auth-with-sdk/src/components/LinkButton/LinkButton.jsx:
--------------------------------------------------------------------------------
1 | import { Box, Link } from '@okta/odyssey-react';
2 |
3 | import classes from './LinkButton.module.css';
4 |
5 | const LinkButton = (props) => {
6 | return (
7 |
8 |
9 |
10 | );
11 | };
12 |
13 | export default LinkButton;
14 |
--------------------------------------------------------------------------------
/samples/templates/partials/env.js:
--------------------------------------------------------------------------------
1 | module.exports = function () {
2 | let oktaEnv;
3 | try {
4 | oktaEnv = require('@okta/env');
5 | } catch (err) {
6 | if (err.code === 'MODULE_NOT_FOUND') {
7 | // try local env module
8 | oktaEnv = require('./okta-env');
9 | return oktaEnv;
10 | }
11 |
12 | throw err;
13 | }
14 |
15 | return oktaEnv;
16 | };
17 |
--------------------------------------------------------------------------------
/test/apps/verify-entries/.gitignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | logs
3 | *.log
4 | npm-debug.log*
5 | yarn-debug.log*
6 | yarn-error.log*
7 | pnpm-debug.log*
8 | lerna-debug.log*
9 |
10 | node_modules
11 | dist
12 | dist-ssr
13 | *.local
14 |
15 | # Editor directories and files
16 | .vscode/*
17 | !.vscode/extensions.json
18 | .idea
19 | .DS_Store
20 | *.suo
21 | *.ntvs*
22 | *.njsproj
23 | *.sln
24 | *.sw?
25 |
--------------------------------------------------------------------------------
/test/support/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "parserOptions": {
3 | "sourceType": "module"
4 | },
5 | "globals": {
6 | "it": "readonly",
7 | "jest": "readonly",
8 | "expect": "readonly"
9 | },
10 | "rules": {
11 | "max-len": 0,
12 | "node/no-extraneous-import": ["error", {
13 | "allowModules": [
14 | "@okta/okta-auth-js"
15 | ]
16 | }]
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/samples/test/support/check/checkLink.ts:
--------------------------------------------------------------------------------
1 | import waitForDisplayed from '../wait/waitForDisplayed';
2 | import links from '../selectors/maps/links';
3 |
4 | export default async function checkLink(linkName: string) {
5 | const link = (links as any)[linkName];
6 | if (!link) {
7 | throw new Error(`No link can match name ${linkName}`);
8 | }
9 | await waitForDisplayed(`a[href="${link}"]`);
10 | }
11 |
--------------------------------------------------------------------------------
/scripts/e2e/e2e-dpop.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | source $(dirname "${BASH_SOURCE[0]}")/../setup-e2e.sh
4 |
5 | setup_e2e
6 |
7 | export TEST_NAME=e2e-dpop
8 |
9 | export ISSUER=https://oie-signin-widget.okta.com
10 | export CLIENT_ID=0oact2w7c2FiHEeoi697
11 | export SPA_CLIENT_ID=0oact2w7c2FiHEeoi697
12 | export ORG_OIE_ENABLED=true
13 |
14 | run_e2e
15 |
16 | export REFRESH_TOKEN=true
17 |
18 | run_e2e
19 |
--------------------------------------------------------------------------------
/samples/generated/express-web-no-oidc/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@okta/samples.express-web-no-oidc",
3 | "private": true,
4 | "version": "1.0.0",
5 | "main": "index.js",
6 | "scripts": {
7 | "start": "node server.js",
8 | "test": "echo \"Error: no test specified\" && exit 1"
9 | },
10 | "dependencies": {
11 | "express": "^4.17.1",
12 | "@okta/okta-auth-js": "*"
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/scripts/e2e/e2e.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | source $(dirname "${BASH_SOURCE[0]}")/../setup-e2e.sh
4 |
5 | setup_e2e
6 |
7 | # overrides
8 | export ISSUER=https://oie-signin-widget.okta.com/oauth2/default
9 |
10 | export TEST_NAME=e2e
11 |
12 | # This client has refresh token enabled
13 | export CLIENT_ID=0oa8lrg7ojTsbJgRQ696
14 | export REFRESH_TOKEN=true
15 | export ORG_OIE_ENABLED=true
16 |
17 | run_e2e
18 |
--------------------------------------------------------------------------------
/samples/generated/react-embedded-auth-with-sdk/.gitignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | logs
3 | *.log
4 | npm-debug.log*
5 | yarn-debug.log*
6 | yarn-error.log*
7 | pnpm-debug.log*
8 | lerna-debug.log*
9 |
10 | node_modules
11 | dist
12 | dist-ssr
13 | *.local
14 |
15 | # Editor directories and files
16 | .vscode/*
17 | !.vscode/extensions.json
18 | .idea
19 | .DS_Store
20 | *.suo
21 | *.ntvs*
22 | *.njsproj
23 | *.sln
24 | *.sw?
25 |
--------------------------------------------------------------------------------
/samples/templates/static-spa/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "{{ name }}",
3 | "private": true,
4 | "version": "1.0.0",
5 | "main": "index.js",
6 | "scripts": {
7 | "start": "node server.js",
8 | "test": "echo \"Error: no test specified\" && exit 1"
9 | },
10 | "dependencies": {
11 | "@okta/okta-auth-js": "*"
12 | },
13 | "devDependencies": {
14 | "express": "^4.17.1"
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/samples/generated/express-embedded-auth-with-sdk/.eslintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | env: {
3 | browser: false,
4 | node: true
5 | },
6 | ignorePatterns: ['assets/js/*.js'],
7 | overrides: [{
8 | files: ['public/*.js'],
9 | rules: {
10 | 'node/no-unsupported-features/node-builtins': 0
11 | },
12 | env: {
13 | browser: true,
14 | node: false
15 | }
16 | }]
17 | };
18 |
--------------------------------------------------------------------------------
/samples/generated/static-spa/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@okta/samples.static-spa",
3 | "private": true,
4 | "version": "1.0.0",
5 | "main": "index.js",
6 | "scripts": {
7 | "start": "node server.js",
8 | "test": "echo \"Error: no test specified\" && exit 1"
9 | },
10 | "dependencies": {
11 | "@okta/okta-auth-js": "*"
12 | },
13 | "devDependencies": {
14 | "express": "^4.17.1"
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/test/apps/app/public/renew/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
13 |
14 |
--------------------------------------------------------------------------------
/test/apps/app/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "outDir": "./public/dist",
4 | "noImplicitAny": true,
5 | "noEmit": false,
6 | "module": "es6",
7 | "target": "es5",
8 | "allowJs": true,
9 | "sourceMap": true,
10 | "moduleResolution": "node",
11 | "baseUrl": "./",
12 | "skipLibCheck": true
13 | },
14 | "include": [
15 | "src/**/*.ts",
16 | "src/**/*.js"
17 | ]
18 | }
--------------------------------------------------------------------------------
/samples/test/support/management-api/createGroup.ts:
--------------------------------------------------------------------------------
1 | import { randomStr } from '../../util';
2 | import getOktaClient, { OktaClientConfig } from './util/getOktaClient';
3 |
4 | export default async (config: OktaClientConfig) => {
5 | const oktaClient = getOktaClient(config);
6 | const group = await oktaClient.createGroup({
7 | profile: {
8 | name: `TestGroup-${randomStr(6)}`
9 | }
10 | });
11 | return group;
12 | };
13 |
--------------------------------------------------------------------------------
/samples/test/util/getTotp.js:
--------------------------------------------------------------------------------
1 | const totp = require('totp-generator');
2 |
3 | export const TOTP_TYPES = {
4 | ENROLL: 'enrollment',
5 | AUTH: 'authentication'
6 | };
7 |
8 | export function getTotp(sharedSecret, type = TOTP_TYPES.AUTH) {
9 | // avoid using same passcode for enroll and auth
10 | const timestamp = type === TOTP_TYPES.ENROLL ? Date.now() - 30 * 3000 : Date.now();
11 | return totp(sharedSecret, { timestamp });
12 | }
13 |
--------------------------------------------------------------------------------
/samples/templates/webpack-spa/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | {{> styles.html }}
8 |
9 |
10 | {{> spa/ui.html }}
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/samples/test/support/selectors/Page.ts:
--------------------------------------------------------------------------------
1 | export interface Page {
2 | isDisplayedElementSelector: string;
3 | isDisplayedElementText?: string | string[];
4 | }
5 |
6 | export abstract class PageWithTitle implements Page {
7 | title: string | string[] = '';
8 |
9 | get pageTitle() { return '#page-title-header'; }
10 | get isDisplayedElementSelector() { return this.pageTitle; }
11 | get isDisplayedElementText() { return this.title; }
12 | }
13 |
--------------------------------------------------------------------------------
/test/apps/react-mfa-v1/src/config.js:
--------------------------------------------------------------------------------
1 | const CLIENT_ID = process.env.SPA_CLIENT_ID || process.env.CLIENT_ID || '{clientId}';
2 | const ISSUER = process.env.ISSUER || 'https://{yourOktaDomain}.com/oauth2/default';
3 | const REDIRECT_URI = `${window.location.origin}/login/callback`;
4 |
5 | export default {
6 | clientId: CLIENT_ID,
7 | issuer: ISSUER,
8 | redirectUri: REDIRECT_URI,
9 | scopes: ['openid', 'profile', 'email'],
10 | pkce: true
11 | };
12 |
--------------------------------------------------------------------------------
/samples/generated/express-web-with-oidc/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@okta/samples.express-web-with-oidc",
3 | "private": true,
4 | "version": "1.0.0",
5 | "main": "index.js",
6 | "scripts": {
7 | "start": "node server.js",
8 | "test": "echo \"Error: no test specified\" && exit 1"
9 | },
10 | "dependencies": {
11 | "btoa": "^1.2.1",
12 | "express": "^4.17.1",
13 | "uuid": "^8.3.0",
14 | "@okta/okta-auth-js": "*"
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/samples/test/features/federated-auth.feature:
--------------------------------------------------------------------------------
1 | Feature: Federated Authentication
2 |
3 | Scenario: Redirect to Okta for authentictaion
4 | Given Login button is displayed
5 | When User clicks the login button
6 | Then Browser is redirected to the Okta-hosted login page
7 | When User enters usernaame
8 | And User enters password
9 | And User clicks login
10 | Then Browser is redirected to the app
11 | And User can verify their profile data
--------------------------------------------------------------------------------
/test/apps/tree-shaking/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@okta/tree-shaking",
3 | "version": "0.0.1",
4 | "private": true,
5 | "scripts": {
6 | "clean": "rimraf target",
7 | "build": "webpack"
8 | },
9 | "main": "index.js",
10 | "dependencies": {
11 | "@okta/okta-auth-js": "*"
12 | },
13 | "devDependencies": {
14 | "webpack": "^5.78.0",
15 | "webpack-bundle-analyzer": "^4.5.0",
16 | "terser-webpack-plugin": "^5.3.6"
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/test/integration/spec/myaccount/__snapshots__/sendRequest.ts.snap:
--------------------------------------------------------------------------------
1 | // Jest Snapshot v1, https://goo.gl/fbAQLP
2 |
3 | exports[`lower level sendRequest function against "/idp/myaccount/emails" endpoint can get emails with "okta.myAccount.email.read" token scope 1`] = `
4 | Object {
5 | "headers": Any