Skip to content
Snippets Groups Projects
Commit 89af6c4e authored by Daniel Gerhardt's avatar Daniel Gerhardt
Browse files

Migrate to Pac4j version 2.1

parent 08db26bd
No related merge requests found
......@@ -217,12 +217,12 @@
<dependency>
<groupId>org.pac4j</groupId>
<artifactId>spring-security-pac4j</artifactId>
<version>2.1.2</version>
<version>3.0.0</version>
</dependency>
<dependency>
<groupId>org.pac4j</groupId>
<artifactId>pac4j-oauth</artifactId>
<version>1.9.7</version>
<version>2.1.0</version>
</dependency>
<dependency>
<groupId>com.corundumstudio.socketio</groupId>
......
......@@ -57,7 +57,7 @@ public class User implements Serializable {
}
public User(FacebookProfile profile) {
setUsername(profile.getProfileUrl());
setUsername(profile.getProfileUrl().toString());
setType(User.FACEBOOK);
}
......
......@@ -23,9 +23,9 @@ import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.BlockJUnit4ClassRunner;
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.Google2Profile;
import org.pac4j.oauth.profile.google2.Google2ProfileDefinition;
import org.springframework.security.authentication.AnonymousAuthenticationToken;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.GrantedAuthority;
......@@ -62,8 +62,8 @@ public class UserServiceTest {
ArrayList<Google2Email> emails = new ArrayList<>();
emails.add(email);
Google2Profile profile = new Google2Profile();
profile.addAttribute(Google2AttributesDefinition.DISPLAY_NAME, "ptsr00");
profile.addAttribute(Google2AttributesDefinition.EMAILS, JsonHelper.toJSONString(emails));
profile.addAttribute(Google2ProfileDefinition.DISPLAY_NAME, "ptsr00");
profile.addAttribute(Google2ProfileDefinition.EMAILS, emails);
socketid2user.put(UUID.randomUUID(), new User(profile));
List<GrantedAuthority> authorities = new ArrayList<>();
......
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