Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openbis
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sispub
openbis
Commits
85def862
Commit
85def862
authored
2 years ago
by
juanf
Browse files
Options
Downloads
Patches
Plain Diff
SSDM-13362: Bugfix, Personal access tokens do not work if emails are used for login
parent
6bf6a294
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!40
SSDM-13578 : 2PT : Database and V3 Implementation - include the new AFS "free"...
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
server-application-server/source/java/ch/systemsx/cisd/openbis/generic/server/pat/PersonalAccessTokenOpenBisSessionManagerDecorator.java
+24
-9
24 additions, 9 deletions
...at/PersonalAccessTokenOpenBisSessionManagerDecorator.java
with
24 additions
and
9 deletions
server-application-server/source/java/ch/systemsx/cisd/openbis/generic/server/pat/PersonalAccessTokenOpenBisSessionManagerDecorator.java
+
24
−
9
View file @
85def862
...
@@ -318,25 +318,40 @@ public class PersonalAccessTokenOpenBisSessionManagerDecorator implements IOpenB
...
@@ -318,25 +318,40 @@ public class PersonalAccessTokenOpenBisSessionManagerDecorator implements IOpenB
{
{
try
try
{
{
final
Principal
principal
=
authenticationService
.
getPrincipal
(
patSession
.
getOwnerId
());
if
(
principal
==
null
)
PersonPE
person
=
daoFactory
.
getPersonDAO
().
tryFindPersonByUserId
(
patSession
.
getOwnerId
());
if
(
person
==
null
)
{
{
operationLog
.
warn
(
"Ignoring a personal access token session ("
+
patSession
operationLog
.
warn
(
"Ignoring a personal access token session ("
+
patSession
+
") because the session's owner was not found
by
the
authentication servic
e."
);
+
") because the session's owner was not found
in
the
openBIS databas
e."
);
return
null
;
return
null
;
}
else
{
principal
.
setAuthenticated
(
true
);
}
}
PersonPE
person
=
daoFactory
.
getPersonDAO
().
tryFindPersonByUserId
(
patSession
.
getOwnerId
());
Principal
principal
=
null
;
try
{
principal
=
authenticationService
.
getPrincipal
(
patSession
.
getOwnerId
());
}
catch
(
Exception
ex1
)
{
try
{
if
(
authenticationService
.
supportsAuthenticatingByEmail
())
{
principal
=
authenticationService
.
getPrincipal
(
person
.
getEmail
());
}
}
catch
(
Exception
ex2
)
{
operationLog
.
warn
(
ex2
);
}
}
if
(
p
erson
==
null
)
if
(
p
rincipal
==
null
)
{
{
operationLog
.
warn
(
"Ignoring a personal access token session ("
+
patSession
operationLog
.
warn
(
"Ignoring a personal access token session ("
+
patSession
+
") because the session's owner was not found
in
the
openBIS databas
e."
);
+
") because the session's owner was not found
by
the
authentication servic
e."
);
return
null
;
return
null
;
}
else
{
principal
.
setAuthenticated
(
true
);
}
}
final
Session
session
=
sessionFactory
.
create
(
patSession
.
getHash
(),
patSession
.
getOwnerId
(),
principal
,
getRemoteHost
(),
final
Session
session
=
sessionFactory
.
create
(
patSession
.
getHash
(),
patSession
.
getOwnerId
(),
principal
,
getRemoteHost
(),
...
...
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