Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
Démonstration auth VR
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
Container 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
ViaRézo
Formations
Démonstration auth VR
Commits
ad4422b2
Verified
Commit
ad4422b2
authored
4 months ago
by
Arthur Conrozier
Browse files
Options
Downloads
Patches
Plain Diff
expired id
parent
b1408368
No related branches found
No related tags found
1 merge request
!1
Updating main
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
main.py
+17
-4
17 additions, 4 deletions
main.py
with
17 additions
and
4 deletions
main.py
+
17
−
4
View file @
ad4422b2
...
...
@@ -167,15 +167,28 @@ def getLoginUrl(state, nonce):
def
decodeIdToken
(
id_token
,
nonce
):
try
:
# Verify token signature
decoded_id_token
=
jwt
.
decode
(
id_token
,
PUBLIC_KEY
,
algorithms
=
[
"
RS256
"
],
audience
=
CLIENT_ID
)
except
jwt
.
ExpiredSignatureError
:
return
'
Token expired
'
,
401
except
jwt
.
InvalidAudienceError
:
return
'
Invalid audience
'
,
401
except
jwt
.
InvalidIssuerError
:
return
'
Invalid issuer
'
,
401
except
jwt
.
InvalidSignatureError
:
return
'
Invalid signature
'
,
401
except
:
return
'
Invalid token
'
,
401
# Verify nonce to prevent replay attacks
if
decoded_id_token
.
get
(
"
nonce
"
)
!=
nonce
:
return
print
(
decoded_id_token
)
return
decoded_id_token
...
...
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