cfa_cypress_okta_authentication_module
v1.0.2
Published
This module started as an attempt to authenticate into OKTA applications through API interactions.
Readme
CFA Cypress Okta Authentication Module
This module started as an attempt to authenticate into OKTA applications through API interactions.
Code
var sessionToken = "";
var applicationURL = "";
describe('OKTA Authentication', function() {
it('Perform the okta API calls before visiting the site', function() {
cy.request('POST', 'https://cfahome.oktapreview.com/api/v1/authn', {
"username": "",
"password": "",
"options": {
"multiOptionalFactorEnroll": true,
"warnBeforePasswordExpired": true
}
})
.then((response) => {
sessionToken = response.body.sessionToken;
cy.request('POST', 'https://cfahome.oktapreview.com/api/v1/sessions', {
"sessionToken": sessionToken
})
.then((response) => {
console.log(response.body);
var options = {};
options.domain = '.cfahome.oktapreview.com';
options.log = 'true';
cy.setCookie('sid', response.body.id, options);
})
})
cy.visit('')
});
});