Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
djangoldp-account
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
djangoldp-packages
djangoldp-account
Commits
795998a8
Commit
795998a8
authored
3 weeks ago
by
SlyRock
Browse files
Options
Downloads
Patches
Plain Diff
chore: temporarily disable token and request validation checks
parent
87f6a4ad
No related branches found
No related tags found
No related merge requests found
Pipeline
#19710
failed
3 weeks ago
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
djangoldp_account/auth/backends.py
+6
-5
6 additions, 5 deletions
djangoldp_account/auth/backends.py
djangoldp_account/auth/solid.py
+2
-2
2 additions, 2 deletions
djangoldp_account/auth/solid.py
with
8 additions
and
7 deletions
djangoldp_account/auth/backends.py
+
6
−
5
View file @
795998a8
...
...
@@ -104,7 +104,8 @@ class ExternalUserBackend(ModelBackend):
body
=
token_raw
.
split
(
'
.
'
)[
0
]
header
=
json
.
loads
(
base64url_decode
(
body
))
return
[
key
for
key
in
keys
[
'
keys
'
]
if
key
[
'
kid
'
]
==
header
[
'
kid
'
]][
0
]
# return [key for key in keys['keys'] if key['kid'] == header['kid']][0]
return
keys
[
'
keys
'
][
0
]
except
IndexError
:
raise
LDPLoginError
(
'
access token key not matching OP
'
)
...
...
@@ -113,10 +114,10 @@ class ExternalUserBackend(ModelBackend):
keys
=
retrieve_op_keys
()
jwk
=
find_key
(
keys
)
try
:
verify_signature
(
jwk
,
token_raw
,
token_claims
[
'
aud
'
])
except
TokenError
:
raise
LDPLoginError
(
'
access token signature invalid
'
)
#
try:
#
verify_signature(jwk, token_raw, token_claims['aud'])
#
except TokenError:
#
raise LDPLoginError('access token signature invalid')
def
validate_dpop_token
(
self
,
request
,
token
):
# the RS first checks that the DPoP token was signed by the public key from the header jwk
...
...
This diff is collapsed.
Click to expand it.
djangoldp_account/auth/solid.py
+
2
−
2
View file @
795998a8
...
...
@@ -25,8 +25,8 @@ class Solid(object):
request_url
=
urlparse
(
request
.
build_absolute_uri
())
# reject if the htu does not match the protocol, origin and path of the request
if
htu
.
scheme
!=
request_url
.
scheme
or
htu
.
hostname
!=
request_url
.
hostname
or
unquote
(
htu
.
path
)
!=
unquote
(
request_url
.
path
):
raise
LDPLoginError
(
'
htu_claim_not_matching_request
'
)
#
if htu.scheme != request_url.scheme or htu.hostname != request_url.hostname or unquote(htu.path) != unquote(request_url.path):
#
raise LDPLoginError('htu_claim_not_matching_request')
@classonlymethod
def
check_htm_claim
(
cls
,
request
,
claims
):
...
...
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