Ike Johnson-Woods
1 year ago
No known key found for this signature in database
GPG Key ID: 19675BB3F8E759D6
2 changed files with
7 additions and
7 deletions
-
pom.xml
-
src/main/java/org/keycloak/social/discord/DiscordIdentityProvider.java
|
|
@ -7,11 +7,11 @@ |
|
|
|
|
|
|
|
<groupId>org.keycloak.extensions</groupId> |
|
|
|
<artifactId>keycloak-discord</artifactId> |
|
|
|
<version>0.5.2</version> |
|
|
|
<version>0.5.3</version> |
|
|
|
<packaging>jar</packaging> |
|
|
|
|
|
|
|
<properties> |
|
|
|
<version.keycloak>23.0.0</version.keycloak> |
|
|
|
<version.keycloak>25.0.0</version.keycloak> |
|
|
|
</properties> |
|
|
|
|
|
|
|
<dependencies> |
|
|
@ -48,8 +48,8 @@ |
|
|
|
<artifactId>maven-compiler-plugin</artifactId> |
|
|
|
<version>3.11.0</version> |
|
|
|
<configuration> |
|
|
|
<source>17</source> |
|
|
|
<target>17</target> |
|
|
|
<source>21</source> |
|
|
|
<target>21</target> |
|
|
|
</configuration> |
|
|
|
</plugin> |
|
|
|
</plugins> |
|
|
|
|
|
@ -77,18 +77,18 @@ public class DiscordIdentityProvider extends AbstractOAuth2IdentityProvider<Disc |
|
|
|
|
|
|
|
@Override |
|
|
|
protected BrokeredIdentityContext extractIdentityFromProfile(EventBuilder event, JsonNode profile) { |
|
|
|
BrokeredIdentityContext user = new BrokeredIdentityContext(getJsonProperty(profile, "id")); |
|
|
|
|
|
|
|
String id = getJsonProperty(profile, "id"); |
|
|
|
String username = getJsonProperty(profile, "username"); |
|
|
|
String discriminator = getJsonProperty(profile, "discriminator"); |
|
|
|
|
|
|
|
BrokeredIdentityContext user = new BrokeredIdentityContext(id, getConfig()); |
|
|
|
|
|
|
|
if (!"0".equals(discriminator)) { |
|
|
|
username += "#" + discriminator; |
|
|
|
} |
|
|
|
|
|
|
|
user.setUsername(username); |
|
|
|
user.setEmail(getJsonProperty(profile, "email")); |
|
|
|
user.setIdpConfig(getConfig()); |
|
|
|
user.setIdp(this); |
|
|
|
|
|
|
|
AbstractJsonUserAttributeMapper.storeUserProfileForMapper(user, profile, getConfig().getAlias()); |
|
|
|