Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
dashboard
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
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AURA
dashboard
Commits
421822f5
Commit
421822f5
authored
6 years ago
by
jackie / Andrea Ida Malkah Klaura
Browse files
Options
Downloads
Patches
Plain Diff
code cleanup and minor fixes
parent
6332ae47
Branches
feature-oidc-expiration
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
config/dev.env.js
+5
-1
5 additions, 1 deletion
config/dev.env.js
src/App.vue
+8
-20
8 additions, 20 deletions
src/App.vue
static/oidc_callback.html
+0
-1
0 additions, 1 deletion
static/oidc_callback.html
with
13 additions
and
22 deletions
config/dev.env.js
+
5
−
1
View file @
421822f5
...
...
@@ -9,8 +9,12 @@ module.exports = merge(prodEnv, {
API_STEERING_SHOWS
:
'
"http://127.0.0.1:8000/api/v1/shows/"
'
,
// OIDC endpoint of the pv/steering module
API_STEERING_OIDC_URI
:
'
"http://localhost:8000/openid"
'
,
// local callback handler that is called by the pv/steering OIDC module after login
// number of seconds before token gets invalid, when renewal should be started
API_STEERING_OIDC_EXPIRE_NOTIFICATION
:
'
120
'
,
// local callback handlers that are called by the pv/steering OIDC module after login/renwal
API_STEERING_OIDC_REDIRECT_URI
:
'
"http://localhost:8080/static/oidc_callback.html"
'
,
API_STEERING_OIDC_REDIRECT_URI_SILENT
:
'
"http://localhost:8080/static/oidc_callback_silentRenew.html"
'
,
API_STEERING_OIDC_REDIRECT_URI_POPUP
:
'
"http://localhost:8080/static/oidc_callback_popupRenew.html"
'
,
// address that is called by the pv/steering OIDC module after logout - should be the dashboard entry point
API_STEERING_OIDC_REDIRECT_URI_POSTLOGOUT
:
'
"http://localhost:8080"
'
})
This diff is collapsed.
Click to expand it.
src/App.vue
+
8
−
20
View file @
421822f5
...
...
@@ -50,12 +50,11 @@ export default {
redirect_uri
:
process
.
env
.
API_STEERING_OIDC_REDIRECT_URI
,
silent_redirect_uri
:
'
http://localhost:8080/static/oidc_callback_silentRenew.html
'
,
popup_redirect_uri
:
'
http://localhost:8080/static/oidc_callback_popupRenew.html
'
,
accessTokenExpiringNotificationTime
:
process
.
env
.
API_STEERING_OIDC_EXPIRE_NOTIFICATION
,
response_type
:
'
id_token token
'
,
scope
:
'
openid profile email
'
,
post_logout_redirect_uri
:
process
.
env
.
API_STEERING_OIDC_REDIRECT_URI_POSTLOGOUT
,
loadUserInfo
:
true
,
// automaticSilentRenew: true
automaticSilentRenew
:
false
loadUserInfo
:
true
})
}
},
...
...
@@ -89,6 +88,8 @@ export default {
self
.
user
.
email
=
''
self
.
user
.
access_token
=
''
}
else
{
// TODO: check user.expires_at
// if token already expired try to get a new one or mark the user as logged out
self
.
setUserProperties
(
user
)
}
}).
catch
(
function
(
err
)
{
...
...
@@ -101,6 +102,7 @@ export default {
this
.
user
.
name
=
user
.
profile
.
nickname
this
.
user
.
email
=
user
.
profile
.
email
this
.
user
.
access_token
=
user
.
access_token
// TODO: remove debug info after thorough testing
console
.
log
(
new
Date
(
user
.
expires_at
*
1000
).
toString
())
console
.
log
(
new
Date
(
user
.
expires_at
*
1000
).
toUTCString
())
console
.
log
(
user
.
access_token
)
...
...
@@ -110,29 +112,15 @@ export default {
// TODO: remove oidc logging after thorough testing
oidc
.
Log
.
logger
=
console
let
self
=
this
this
.
oidcmgr
.
events
.
addSilentRenewError
(
function
()
{
// TODO: set accessTokenExpiringNotificationTime when this.oidcmgr is created and insert this value here too
alert
(
'
Your OpenID access token could not be renewed automatically. You will be logged out in 60 seconds.
'
)
})
this
.
oidcmgr
.
events
.
addAccessTokenExpiring
(
function
()
{
console
.
log
(
'
token will soon expire
'
)
/* Use the following code instead of silent renewal if you want to use popups
console.log('starting signinPopup')
self.oidcmgr.signinPopup(function (user) {
console.log('signinPopup result for user:')
console.log(user)
}).catch(function (err) {
console.log(err)
})
*/
console
.
log
(
'
starting signinSilent
'
)
console
.
log
(
'
starting silent access_token renewal
'
)
self
.
oidcmgr
.
signinSilent
().
then
(
function
(
user
)
{
console
.
log
(
'
signinPopup result for user:
'
)
console
.
log
(
self
.
user
.
access_token
)
self
.
user
.
access_token
=
user
.
access_token
console
.
log
(
self
.
user
.
access_token
)
}).
catch
(
function
(
err
)
{
console
.
log
(
err
)
alert
(
'
Your OpenID access token could not be renewed automatically.
\n
'
+
'
You will be logged out in
'
+
process
.
env
.
API_STEERING_OIDC_EXPIRE_NOTIFICATION
+
'
seconds.
'
)
})
})
this
.
oidcmgr
.
events
.
addAccessTokenExpired
(
function
()
{
...
...
This diff is collapsed.
Click to expand it.
static/oidc_callback.html
+
0
−
1
View file @
421822f5
...
...
@@ -11,7 +11,6 @@
<script>
var
mgr
=
new
Oidc
.
UserManager
({
userStore
:
new
Oidc
.
WebStorageStateStore
()})
mgr
.
signinRedirectCallback
().
then
(
function
(
user
)
{
console
.
log
(
user
)
window
.
location
.
href
=
'
../
'
}).
catch
(
function
(
err
)
{
console
.
log
(
err
)
...
...
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