Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.then(() => {
this.oktaAuth = this.oktaAuth || new OktaAuth(this.config); // can throw
this.oktaAuth.tokenManager.on('error', this._onTokenError.bind(this));
});
},
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;
function bootstrap(config) {
config = Object.assign({}, DEFAULT_CONFIG, config);
sdk = new OktaAuth(config);
sdk.tokenManager.clear();
return Promise.resolve();
}
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,
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,
util.mockDeleteCookie = function () {
return jest.spyOn(cookies, 'delete');
};
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);
}