GitLab steht wegen Wartungsarbeiten am Montag, den 10. Mai, zwischen 17:00 und 19:00 Uhr nicht zur Verfügung.

Commit 89af6c4e authored by Daniel Gerhardt's avatar Daniel Gerhardt

Migrate to Pac4j version 2.1

parent 08db26bd
...@@ -217,12 +217,12 @@ ...@@ -217,12 +217,12 @@
<dependency> <dependency>
<groupId>org.pac4j</groupId> <groupId>org.pac4j</groupId>
<artifactId>spring-security-pac4j</artifactId> <artifactId>spring-security-pac4j</artifactId>
<version>2.1.2</version> <version>3.0.0</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.pac4j</groupId> <groupId>org.pac4j</groupId>
<artifactId>pac4j-oauth</artifactId> <artifactId>pac4j-oauth</artifactId>
<version>1.9.7</version> <version>2.1.0</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.corundumstudio.socketio</groupId> <groupId>com.corundumstudio.socketio</groupId>
......
...@@ -57,7 +57,7 @@ public class User implements Serializable { ...@@ -57,7 +57,7 @@ public class User implements Serializable {
} }
public User(FacebookProfile profile) { public User(FacebookProfile profile) {
setUsername(profile.getProfileUrl()); setUsername(profile.getProfileUrl().toString());
setType(User.FACEBOOK); setType(User.FACEBOOK);
} }
......
...@@ -23,9 +23,9 @@ import org.junit.Test; ...@@ -23,9 +23,9 @@ import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.junit.runners.BlockJUnit4ClassRunner; import org.junit.runners.BlockJUnit4ClassRunner;
import org.pac4j.oauth.profile.JsonHelper; import org.pac4j.oauth.profile.JsonHelper;
import org.pac4j.oauth.profile.google2.Google2AttributesDefinition;
import org.pac4j.oauth.profile.google2.Google2Email; import org.pac4j.oauth.profile.google2.Google2Email;
import org.pac4j.oauth.profile.google2.Google2Profile; import org.pac4j.oauth.profile.google2.Google2Profile;
import org.pac4j.oauth.profile.google2.Google2ProfileDefinition;
import org.springframework.security.authentication.AnonymousAuthenticationToken; import org.springframework.security.authentication.AnonymousAuthenticationToken;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.GrantedAuthority;
...@@ -62,8 +62,8 @@ public class UserServiceTest { ...@@ -62,8 +62,8 @@ public class UserServiceTest {
ArrayList<Google2Email> emails = new ArrayList<>(); ArrayList<Google2Email> emails = new ArrayList<>();
emails.add(email); emails.add(email);
Google2Profile profile = new Google2Profile(); Google2Profile profile = new Google2Profile();
profile.addAttribute(Google2AttributesDefinition.DISPLAY_NAME, "ptsr00"); profile.addAttribute(Google2ProfileDefinition.DISPLAY_NAME, "ptsr00");
profile.addAttribute(Google2AttributesDefinition.EMAILS, JsonHelper.toJSONString(emails)); profile.addAttribute(Google2ProfileDefinition.EMAILS, emails);
socketid2user.put(UUID.randomUUID(), new User(profile)); socketid2user.put(UUID.randomUUID(), new User(profile));
List<GrantedAuthority> authorities = new ArrayList<>(); List<GrantedAuthority> authorities = new ArrayList<>();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment