How to use @okta/okta-auth-js - 7 common examples

To help you get started, we’ve selected a few @okta/okta-auth-js examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github okta / okta-auth-js / test / app / src / testApp.js View on Github external
.then(() => {
        this.oktaAuth = this.oktaAuth || new OktaAuth(this.config); // can throw
        this.oktaAuth.tokenManager.on('error', this._onTokenError.bind(this));
      });
  },
github Robinyo / serendipity / projects / auth-okta / src / lib / services / auth / auth.service.ts View on Github external
constructor(@Inject(OktaConfigService) private config: OktaConfig,
              private router: Router,
              private logger: LoggerService) {

    super();

    this.logger.info('OktaAuthService: constructor()');

    this.logger.info('OktaAuthService this.config.okta: ' + JSON.stringify(this.config.okta));

    // this.auth = new OktaAuth(this.config.okta);
    this.auth = new OktaAuth({
      issuer: this.config.okta.issuer,
      clientId: this.config.okta.clientId,
      redirectUri: this.config.okta.redirectUri,
      grantType:  this.config.okta.grantType
    });

    this._isAuthenticated().then(authstate => {

      this.authState$.next(authstate);

      this.authState$.subscribe((authenticated: boolean) => {

        this.logger.info('OktaAuthService isAuthenticated(): ' + this.authenticated);

        this.authenticated = authenticated;
github okta / okta-auth-js / test / karma / spec / renewToken.js View on Github external
function bootstrap(config) {
    config = Object.assign({}, DEFAULT_CONFIG, config);
    sdk = new OktaAuth(config);
    sdk.tokenManager.clear();
    return Promise.resolve();
  }
github okta / okta-signin-widget / test / unit / spec / v2 / IntrospectToken_spec.js View on Github external
function setup (settings, resp) {
  const setNextResponse = Util.mockAjax();
  const baseUrl = 'https://foo.com';
  const authClient = new OktaAuth({ url: baseUrl });
  const router = new Router(_.extend({
    el: $sandbox,
    baseUrl: baseUrl,
    authClient: authClient,
    useIdxPipeline: true
  }, settings));
  const beacon = new Beacon($sandbox);
  const form = new FormView($sandbox);

  Util.registerRouter(router);
  Util.mockRouterNavigate(router);
  Util.mockJqueryCss();
  setNextResponse(resp);
  return Util.mockIntrospectResponse(router, resp).then(function () {
    return {
      router: router,
github okta / okta-signin-widget / test / unit / spec / v2 / controllers / ErrorController_spec.js View on Github external
function setup (settings) {
  const setNextResponse = Util.mockAjax();
  const baseUrl = 'https://foo.com';
  const authClient = new OktaAuth({ url: baseUrl });
  const router = new Router(_.extend({
    el: $sandbox,
    baseUrl: baseUrl,
    authClient: authClient,
    useIdxPipeline: true
  }, settings));
  const beacon = new Beacon($sandbox);
  const form = new FormView($sandbox);

  Util.registerRouter(router);
  Util.mockRouterNavigate(router);
  Util.mockJqueryCss();
  return Q({
    router: router,
    beacon: beacon,
    form: form,
github okta / okta-auth-js / test / support / util.js View on Github external
util.mockDeleteCookie = function () {
  return jest.spyOn(cookies, 'delete');
};
github transmute-industries / transmute / packages / transmute-dashboard / src / components / Auth / Login / LoginForm.js View on Github external
constructor(props) {
    super(props);
    this.state = {
      error: null,
      email: '',
      password: ''
    };
    this.oktaAuth = new OktaAuth({ url: props.baseUrl });
    this.handleSubmit = this.handleSubmit.bind(this);
    this.handleChange = this.handleChange.bind(this);
  }

@okta/okta-auth-js

The Okta Auth SDK

Apache-2.0
Latest version published 3 months ago

Package Health Score

81 / 100
Full package analysis