File tree Expand file tree Collapse file tree
with-idp-initiated-via-proxy Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ start_fakeproxy() {
4646 --publish 9090:9090 \
4747 --env PORT=9090 \
4848 --env RABBITMQ_URL=" ${RABBITMQ_URL_FOR_FAKEPROXY} " \
49- --env UAA_URL =" ${UAA_URL_FOR_FAKEPROXY } " \
49+ --env IDP_TOKEN_ENDPOINT =" ${IDP_TOKEN_ENDPOINT } " \
5050 --env CLIENT_ID=" ${CLIENT_ID} " \
5151 --env CLIENT_SECRET=" ${CLIENT_SECRET} " \
5252 --env NODE_EXTRA_CA_CERTS=/etc/uaa/ca_uaa_certificate.pem \
Original file line number Diff line number Diff line change 11var http = require ( 'http' ) ,
2- httpProxy = require ( 'http-proxy' ) ;
2+ httpProxy = require ( 'http-proxy' ) ;
33
44const XMLHttpRequest = require ( 'xmlhttprequest' ) . XMLHttpRequest
55
66const rabbitmq_url = process . env . RABBITMQ_URL || 'http://0.0.0.0:15672/' ;
77const client_id = process . env . CLIENT_ID ;
88const client_secret = process . env . CLIENT_SECRET ;
9- const uaa_url = process . env . UAA_URL ;
109const port = process . env . PORT ;
10+ const idp_token_endpoint = process . env . IDP_TOKEN_ENDPOINT ;
1111
1212//
1313// Create a proxy server with custom application logic
@@ -52,7 +52,7 @@ function default_if_blank(value, defaultValue) {
5252
5353function access_token ( id , secret ) {
5454 const req = new XMLHttpRequest ( ) ;
55- const url = uaa_url + '/oauth/token' ;
55+ const url = idp_token_endpoint ;
5656 const params = 'client_id=' + id +
5757 '&client_secret=' + secret +
5858 '&grant_type=client_credentials' +
Original file line number Diff line number Diff line change @@ -22,6 +22,18 @@ describe('A user with a JWT token', function () {
2222 assert . equal ( await overview . getUser ( ) , 'User rabbit_idp_user' )
2323 } )
2424
25+
26+ it ( 'can reload page without being logged out' , async function ( ) {
27+ await goToHome ( driver ) ;
28+ await overview . isLoaded ( ) ;
29+
30+ overview . refresh ( )
31+ if ( ! await overview . isLoaded ( ) ) {
32+ throw new Error ( 'Failed to keep session opened' )
33+ }
34+ } )
35+
36+
2537 after ( async function ( ) {
2638 await teardown ( driver , this , captureScreen )
2739 } )
Original file line number Diff line number Diff line change @@ -33,6 +33,20 @@ describe('A user with a JWT token', function () {
3333 assert . equal ( await overview . getUser ( ) , 'User ' + username )
3434 } )
3535
36+ it ( 'can reload page without being logged out' , async function ( ) {
37+ await fakePortal . goToHome ( username , password )
38+ if ( ! await fakePortal . isLoaded ( ) ) {
39+ throw new Error ( 'Failed to load fakePortal' )
40+ }
41+ await fakePortal . login ( )
42+ await overview . isLoaded ( )
43+
44+ overview . refresh ( )
45+ if ( ! await overview . isLoaded ( ) ) {
46+ throw new Error ( 'Failed to keep session opened' )
47+ }
48+ } )
49+
3650 after ( async function ( ) {
3751 await teardown ( driver , this , captureScreen )
3852 } )
You can’t perform that action at this time.
0 commit comments