@christophhu/adfs-login
v1.0.3
Published
ADFS-Login using oauth2.
Downloads
2
Readme
AdfsLogin
Use
Import the AdfsLoginModule
in the app.module.ts
.
import { AdfsLoginModule, AuthGuard, AuthWithForcedLoginGuard } from '@christophhu/adfs-login';
@NgModule({
imports: [
AdfsLoginModule.forRoot(
authConfig,
authModuleConfig
),
...
]
...
})
The authConfig
and authModuleConfig
are seperated into an config with the following content:
import { AuthConfig } from 'angular-oauth2-oidc';
import { OAuthModuleConfig } from 'angular-oauth2-oidc';
export const authModuleConfig: OAuthModuleConfig = {
resourceServer: {
allowedUrls: [
'http://localhost:4200'
],
sendAccessToken: true,
}
}
export const authConfig: AuthConfig = {
issuer : 'https://dc2019.dom.local/adfs',
clientId : '0050e983-4a4e-4076-8d0d-a1b625c4aa06',
redirectUri : 'http://localhost:4200/',
scope : 'openid profile email api',
useSilentRefresh: false,
silentRefreshTimeout: 0
}
Guards
There are two Guards:
- AuthGuard and
- AuthWithForcedLoginGuard
AuthGuard
The AuthGuard will route you if you are logged in. If you are not logged in, that guard interrupt the route-process.
AuthWithForcedLoginGuard
Like the AuthGuard the AuthWithForcedLoginGuard will route you if you are logged in. If not, this will route you to the login-page.