Skip to content
Snippets Groups Projects
Commit 6196a151 authored by Florent Poittevin's avatar Florent Poittevin
Browse files

Retrieve token

parent c62316a8
No related branches found
No related tags found
1 merge request!3Develop
......@@ -20,13 +20,9 @@ export class AppComponent {
// It doesn't send the user the the login page
// this.oauthService.tryLogin();
let option = {};
const isUriContainSearch = window.location.hash.indexOf('#') === -1 && window.location.search !== '';
if (isUriContainSearch) {
option = {
customHashFragment: '#' + window.location.search,
};
}
const option = {
disableOAuth2StateCheck: true,
};
this.oauthService.tryLogin(option);
}
}
......@@ -8,7 +8,6 @@ import {AuthConfig, JwksValidationHandler, OAuthModule, OAuthModuleConfig, OAuth
import {AppRoutingModule} from './app-routing.module';
import {AppComponent} from './app.component';
import {HomeComponent} from './home/home.component';
import {DlcmStorage} from './dlcm.storage';
import {DlcmInterceptor} from './dlcm.interceptor';
import {authConfig, authModuleConfig} from './auth.config';
......@@ -29,7 +28,8 @@ import {authConfig, authModuleConfig} from './auth.config';
providers: [
{provide: OAuthModuleConfig, useValue: authModuleConfig},
{provide: ValidationHandler, useClass: JwksValidationHandler},
{provide: OAuthStorage, useClass: DlcmStorage},
// {provide: OAuthStorage, useClass: DlcmStorage},
{provide: OAuthStorage, useValue: sessionStorage},
{provide: AuthConfig, useValue: authConfig},
{
provide: HTTP_INTERCEPTORS,
......
......@@ -4,7 +4,7 @@ export const authConfig: AuthConfig = {
oidc: false,
loginUrl: 'http://localhost/dlcm/authorisation/authorize',
redirectUri: window.location.origin,
responseType: 'code',
responseType: 'token',
dummyClientSecret: '123abc',
clientId: 'local-dev-angular',
scope: 'READ',
......@@ -13,9 +13,7 @@ export const authConfig: AuthConfig = {
requestAccessToken: true,
showDebugInformation: true,
useIdTokenHintForSilentRefresh: true,
customQueryParams: {
response_type: 'implicit',
},
skipIssuerCheck: true,
};
export const authModuleConfig: OAuthModuleConfig = {
......
......@@ -15,6 +15,7 @@ export class DlcmStorage extends OAuthStorage {
}
getItem(key: string): string | null {
console.log('retrieve ' + key);
return this.storageValues[key];
}
......@@ -23,6 +24,7 @@ export class DlcmStorage extends OAuthStorage {
}
setItem(key: string, data: string): void {
console.log('store ' + key, data);
this.storageValues.set(key, data);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment