Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ARSnova Backend
Manage
Activity
Members
Labels
Plan
Issues
27
Issue boards
Milestones
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Privacy
Imprint
Contact
Snippets
Groups
Projects
Show more breadcrumbs
ARSnova
ARSnova Backend
Commits
87678184
There was an error fetching the commit references. Please try again later.
Commit
87678184
authored
6 years ago
by
Daniel Gerhardt
Browse files
Options
Downloads
Patches
Plain Diff
Adjust generic OIDC implementation for 3.x
parent
ccd554b5
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/de/thm/arsnova/model/UserProfile.java
+1
-0
1 addition, 0 deletions
src/main/java/de/thm/arsnova/model/UserProfile.java
src/main/java/de/thm/arsnova/security/pac4j/OauthUserDetailsService.java
+5
-0
5 additions, 0 deletions
...e/thm/arsnova/security/pac4j/OauthUserDetailsService.java
with
6 additions
and
0 deletions
src/main/java/de/thm/arsnova/model/UserProfile.java
+
1
−
0
View file @
87678184
...
...
@@ -35,6 +35,7 @@ public class UserProfile extends Entity {
ARSNOVA_GUEST
,
LDAP
,
CAS
,
OIDC
,
GOOGLE
,
FACEBOOK
,
TWITTER
...
...
This diff is collapsed.
Click to expand it.
src/main/java/de/thm/arsnova/security/pac4j/OauthUserDetailsService.java
+
5
−
0
View file @
87678184
...
...
@@ -22,6 +22,7 @@ import de.thm.arsnova.security.User;
import
de.thm.arsnova.service.UserService
;
import
org.pac4j.oauth.profile.facebook.FacebookProfile
;
import
org.pac4j.oauth.profile.twitter.TwitterProfile
;
import
org.pac4j.oidc.profile.OidcProfile
;
import
org.pac4j.oidc.profile.google.GoogleOidcProfile
;
import
org.springframework.security.core.GrantedAuthority
;
import
org.springframework.security.core.authority.SimpleGrantedAuthority
;
...
...
@@ -65,6 +66,10 @@ public class OauthUserDetailsService implements AuthenticationUserDetailsService
final
FacebookProfile
profile
=
(
FacebookProfile
)
token
.
getDetails
();
user
=
userService
.
loadUser
(
UserProfile
.
AuthProvider
.
FACEBOOK
,
profile
.
getId
(),
grantedAuthorities
,
true
);
}
else
if
(
token
.
getDetails
()
instanceof
OidcProfile
)
{
final
OidcProfile
profile
=
(
OidcProfile
)
token
.
getDetails
();
user
=
userService
.
loadUser
(
UserProfile
.
AuthProvider
.
OIDC
,
profile
.
getId
(),
grantedAuthorities
,
true
);
}
else
{
throw
new
IllegalArgumentException
(
"AuthenticationToken not supported"
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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