Skip to content

Commit d467d6b

Browse files
Adds OIE tests
OKTA-382516 <<<Jenkins Check-In of Tested SHA: 42635e0 for [email protected]>>> Artifact: samples-js-angular
1 parent 007f408 commit d467d6b

File tree

13 files changed

+156
-131
lines changed

13 files changed

+156
-131
lines changed

.bacon.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,11 @@ test_suites:
66
script_name: e2e
77
criteria: MERGE
88
queue_name: small
9+
10+
- name: e2e-oie
11+
script_path: /root/okta/samples-js-angular/scripts
12+
sort_order: '1'
13+
timeout: '10'
14+
script_name: e2e-oie
15+
criteria: MERGE
16+
queue_name: small

custom-login/env.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ if (fs.existsSync(TESTENV)) {
1111
});
1212
}
1313
process.env.CLIENT_ID = process.env.CLIENT_ID || process.env.SPA_CLIENT_ID;
14+
process.env.USE_INTERACTION_CODE = process.env.USE_INTERACTION_CODE || false;

custom-login/extra-webpack.config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ if (fs.existsSync(TESTENV)) {
1212
});
1313
}
1414
process.env.CLIENT_ID = process.env.CLIENT_ID || process.env.SPA_CLIENT_ID;
15+
process.env.USE_INTERACTION_CODE = process.env.USE_INTERACTION_CODE || false;
1516

1617
const webpack = require('webpack');
1718
const env = {};
@@ -20,6 +21,7 @@ const env = {};
2021
[
2122
'ISSUER',
2223
'CLIENT_ID',
24+
'USE_INTERACTION_CODE'
2325
].forEach(function (key) {
2426
if (!process.env[key]) {
2527
throw new Error(`Environment variable ${key} must be set. See README.md`);

custom-login/package-lock.json

Lines changed: 12 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

custom-login/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"@angular/platform-browser-dynamic": "^11.0.9",
2121
"@angular/router": "^11.0.9",
2222
"@okta/okta-angular": "^3.0.1",
23-
"@okta/okta-signin-widget": "^5.0.0",
23+
"@okta/okta-signin-widget": "^5.5.0",
2424
"colors": "^1.4.0",
2525
"core-js": "^3.6.5",
2626
"rxjs": "^6.6.3",

custom-login/src/app/app.config.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
const { CLIENT_ID, ISSUER, OKTA_TESTING_DISABLEHTTPSCHECK } = process.env;
2+
const USE_INTERACTION_CODE = process.env.USE_INTERACTION_CODE || false;
23

34
export default {
45
oidc: {
@@ -8,7 +9,8 @@ export default {
89
scopes: ['openid', 'profile', 'email'],
910
testing: {
1011
disableHttpsCheck: `${OKTA_TESTING_DISABLEHTTPSCHECK}`
11-
}
12+
},
13+
useInteractionCodeFlow: `${USE_INTERACTION_CODE}`,
1214
},
1315
resourceServer: {
1416
messagesUrl: 'http://localhost:8000/api/messages',

custom-login/src/app/home/home.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ <h1 class="ui header">Custom Login Page with Sign In Widget</h1>
22
<div *ngIf="!isAuthenticated">
33
<p>If you‘re viewing this page then you have successfully started this Angular application.</p>
44
<p>This example shows you how to use the
5-
<a href="https://github.com/okta/okta-oidc-js/tree/master/packages/okta-angular">Okta Angular Library</a>
5+
<a href="https://github.com/okta/okta-angular/tree/master">Okta Angular Library</a>
66
and the
77
<a href="https://github.com/okta/okta-signin-widget">Okta Sign-In Widget</a>
88
to add the

custom-login/src/app/login/login.component.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ import sampleConfig from '../app.config';
1717

1818
const DEFAULT_ORIGINAL_URI = window.location.origin;
1919

20+
let USE_INTERACTION_CODE = false;
21+
if (sampleConfig.oidc.useInteractionCodeFlow === 'true') {
22+
USE_INTERACTION_CODE = true;
23+
}
24+
2025
@Component({
2126
selector: 'app-login',
2227
templateUrl: './login.component.html',
@@ -41,8 +46,10 @@ export class LoginComponent implements OnInit {
4146
},
4247
},
4348
authParams: {
44-
issuer: sampleConfig.oidc.issuer
45-
}
49+
issuer: sampleConfig.oidc.issuer,
50+
scopes: sampleConfig.oidc.scopes
51+
},
52+
useInteractionCodeFlow: USE_INTERACTION_CODE,
4653
});
4754
}
4855

okta-hosted-login/src/app/home/home.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ <h1 class="ui header">PKCE Flow w/ Okta Hosted Login Page</h1>
66
<div *ngIf="!isAuthenticated">
77
<p>If you‘re viewing this page then you have successfully started this Angular application.</p>
88
<p>This example shows you how to use the
9-
<a href="https://github.com/okta/okta-oidc-js/tree/master/packages/okta-angular">Okta Angular Library</a> to add the
9+
<a href="https://github.com/okta/okta-angular/tree/master">Okta Angular Library</a> to add the
1010
<a href="https://developer.okta.com/docs/guides/implement-auth-code-pkce">PKCE Flow</a> to your application.</p>
1111
<p>When you click the login button below, you will be redirected to the login page on your Okta org. After you authenticate,
1212
you will be returned to this application with an ID Token and Access Token. These tokens will be stored in local storage

0 commit comments

Comments
 (0)