Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
angular-oidc-authorization-sample
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Helmut Hutzler
angular-oidc-authorization-sample
Commits
f7a30083
Commit
f7a30083
authored
2 years ago
by
Helmut Hutzler
Browse files
Options
Downloads
Patches
Plain Diff
Updated info Compoment
parent
61400b63
Branches
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#9336
passed
2 years ago
Stage: build-production
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/app/app.component.ts
+4
-1
4 additions, 1 deletion
src/app/app.component.ts
src/app/info/info.component.html
+13
-1
13 additions, 1 deletion
src/app/info/info.component.html
src/app/info/info.component.ts
+19
-4
19 additions, 4 deletions
src/app/info/info.component.ts
with
36 additions
and
6 deletions
src/app/app.component.ts
+
4
−
1
View file @
f7a30083
...
...
@@ -17,7 +17,10 @@ import {environment} from "../environments/environment";
export
class
AppComponent
implements
OnInit
{
title
=
'
sample-code-flow-auto-login-all-routes
'
;
constructor
(
public
oidcSecurityService
:
OidcSecurityService
)
{}
isAuthenticated
=
false
;
appVersion
=
'
0.0.0
'
;
apiUrl
=
'
--
'
;
keycloakURL
=
'
--
'
;
ngOnInit
()
{
this
.
oidcSecurityService
.
checkAuth
().
subscribe
(({
isAuthenticated
,
userData
,
accessToken
,
idToken
})
=>
{
console
.
log
(
"
App-Info::isAuthenticated :
"
+
isAuthenticated
+
"
\n
"
);
...
...
This diff is collapsed.
Click to expand it.
src/app/info/info.component.html
+
13
−
1
View file @
f7a30083
<div><h3>
Test Results for Keycloak Fine-grained Authorization Feature
</h3></div>
<div>
<h4>
App Runtime Parameter
</h4>
<pre>
App-Info::isAuthenticated : {{ isAuthenticated }}
App-Info::appVersion : {{ appVersion }}
App-Info::apiUrl : {{ apiUrl }}
App-Info::keycloakURL : {{ keycloakURL }}
</pre>
</div>
<hr>
<h4>
Application Tests
</h4>
<h5>
Login with superadmin/xxx
</h5>
<pre>
...
...
@@ -38,7 +50,7 @@
<h5>
Implemented OIDC Features
</h5>
<ul>
<li>
Using angular-auth-oidc-client lib 1
3
.1 for Keylcloak Login
</li>
<li>
Using angular-auth-oidc-client lib 1
4
.1
.5
for Keylcloak Login
</li>
<li>
Implementing Autologin Feature from angular-auth-oidc-client
</li>
<li>
Implementing AuthInterceptor from angular-auth-oidc-client
</li>
<li>
Silent renew Access Tokens from angular-auth-oidc-client
</li>
...
...
This diff is collapsed.
Click to expand it.
src/app/info/info.component.ts
+
19
−
4
View file @
f7a30083
import
{
Component
,
OnInit
}
from
'
@angular/core
'
;
import
{
OidcSecurityService
}
from
"
angular-auth-oidc-client
"
;
import
{
environment
}
from
"
../../environments/environment
"
;
@
Component
({
selector
:
'
app-info
'
,
...
...
@@ -7,9 +9,22 @@ import { Component, OnInit } from '@angular/core';
})
export
class
InfoComponent
implements
OnInit
{
constructor
()
{
}
ngOnInit
():
void
{
constructor
(
public
oidcSecurityService
:
OidcSecurityService
)
{}
isAuthenticated
=
false
;
appVersion
=
'
0.0.0
'
;
apiUrl
=
'
--
'
;
keycloakURL
=
'
--
'
;
ngOnInit
()
{
this
.
oidcSecurityService
.
checkAuth
().
subscribe
(({
isAuthenticated
,
userData
,
accessToken
,
idToken
})
=>
{
this
.
isAuthenticated
=
isAuthenticated
;
this
.
appVersion
=
environment
.
appVersion
;
this
.
apiUrl
=
environment
.
apiURL
;
this
.
keycloakURL
=
environment
.
keycloakURL
;
console
.
log
(
"
App-Info::isAuthenticated :
"
+
isAuthenticated
+
"
\n
"
);
console
.
log
(
"
App-Info::appVersion :
"
+
environment
.
appVersion
+
"
\n
"
);
console
.
log
(
"
App-Info::apiUrl :
"
+
environment
.
apiURL
+
"
\n
"
);
console
.
log
(
"
App-Info::keycloakURL :
"
+
environment
.
keycloakURL
+
"
\n
"
);
});
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment