@@ -5,8 +5,6 @@ import SigninRequest from './SigninRequest';
55import SignoutRequest from './SignoutRequest' ;
66import WebStorageStateStore from './WebStorageStateStore' ;
77
8- // const OidcOptionalParams = ["prompt", "display", "max_age", "ui_locales", "id_token_hint", "login_hint", "acr_values"];
9-
108export default class OidcClientService {
119 constructor ( settings ,
1210 stateStore = new WebStorageStateStore ( ) ,
@@ -26,13 +24,23 @@ export default class OidcClientService {
2624 return this . _settings ;
2725 }
2826
29- createSigninRequest ( { response_type, scope, redirect_uri, data} = { } ) {
27+ createSigninRequest ( {
28+ response_type, scope, redirect_uri, data,
29+ prompt, display, max_age, ui_locales, id_token_hint, login_hint, acr_values} = { }
30+ ) {
3031 Log . info ( "OidcClientService.createSigninRequest" ) ;
3132
3233 let client_id = this . _settings . client_id ;
3334 response_type = response_type || this . _settings . response_type ;
3435 scope = scope || this . _settings . scope ;
3536 redirect_uri = redirect_uri || this . _settings . redirect_uri ;
37+
38+ // id_token_hint, login_hint aren't allowed on _settings
39+ prompt = prompt || this . _settings . prompt ;
40+ display = display || this . _settings . display ;
41+ max_age = max_age || this . _settings . max_age ;
42+ ui_locales = ui_locales || this . _settings . ui_locales ;
43+ acr_values = acr_values || this . _settings . acr_values ;
3644
3745 return this . _metadataService . getAuthorizationEndpoint ( ) . then ( url => {
3846 Log . info ( "Received authorization endpoint" , url ) ;
@@ -42,15 +50,16 @@ export default class OidcClientService {
4250 redirect_uri,
4351 response_type,
4452 scope,
45- data
53+ data,
54+ prompt, display, max_age, ui_locales, id_token_hint, login_hint, acr_values
4655 } ) ;
4756 } , err => {
4857 Log . error ( "Failed to create signin request" , err ) ;
4958 throw new Error ( "Failed to create signin request" ) ;
5059 } ) ;
5160 }
5261
53- processSigninResponse ( stateString ) {
62+ processSigninResponse ( url ) {
5463 Log . info ( "OidcClientService.processSigninResponse" ) ;
5564 }
5665
@@ -73,62 +82,9 @@ export default class OidcClientService {
7382 } ) ;
7483 }
7584
76- processSignoutResponse ( stateString ) {
85+ processSignoutResponse ( url ) {
7786 Log . info ( "OidcClientService.processSignoutResponse" ) ;
7887 }
79-
80- // OidcClient.prototype.createTokenRequestAsync = function () {
81- // log("OidcClient.createTokenRequestAsync");
82-
83- // var client = this;
84- // var settings = client._settings;
85-
86- // return client.loadAuthorizationEndpoint().then(function (authorization_endpoint) {
87-
88- // var state = rand();
89- // var url = authorization_endpoint + "?state=" + encodeURIComponent(state);
90-
91- // if (client.isOidc) {
92- // var nonce = rand();
93- // url += "&nonce=" + encodeURIComponent(nonce);
94- // }
95-
96- // var required = ["client_id", "redirect_uri", "response_type", "scope"];
97- // required.forEach(function (key) {
98- // var value = settings[key];
99- // if (value) {
100- // url += "&" + key + "=" + encodeURIComponent(value);
101- // }
102- // });
103-
104- // var optional = ["prompt", "display", "max_age", "ui_locales", "id_token_hint", "login_hint", "acr_values"];
105- // optional.forEach(function (key) {
106- // var value = settings[key];
107- // if (value) {
108- // url += "&" + key + "=" + encodeURIComponent(value);
109- // }
110- // });
111-
112- // var request_state = {
113- // oidc: client.isOidc,
114- // oauth: client.isOAuth,
115- // state: state
116- // };
117-
118- // if (nonce) {
119- // request_state["nonce"] = nonce;
120- // }
121-
122- // settings.request_state_store.setItem(settings.request_state_key, JSON.stringify(request_state));
123-
124- // return {
125- // request_state: request_state,
126- // url: url
127- // };
128- // });
129- // }
130-
131-
13288
13389// OidcClient.prototype.processResponseAsync = function (queryString) {
13490// log("OidcClient.processResponseAsync");
0 commit comments