Browse Source
Merge pull request #5 from wadahiro/issue-4
Support keycloak 9.0.2 and use "Theme Resources" for the template
pull/8/head
Hiroyuki Wada
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with
98 additions and
16 deletions
.github/workflows/pull_request.yml
.github/workflows/release.yml
.releaserc
README.md
ear/pom.xml
ejb/pom.xml
ejb/src/main/java/org/keycloak/social/discord/DiscordIdentityProviderConfig.java
ejb/src/main/java/org/keycloak/social/discord/DiscordIdentityProviderFactory.java
ejb/src/main/resources/META-INF/keycloak-themes.json
ejb/src/main/resources/theme-resources/messages/admin-messages_en.properties
ejb/src/main/resources/theme-resources/resources/partials/realm-identity-provider-discord-ext.html
ejb/src/main/resources/theme-resources/resources/partials/realm-identity-provider-discord.html
ejb/src/main/resources/theme/discord/admin/theme.properties
pom.xml
@ -0,0 +1,24 @@
name : Pull Request CI
on : [ pull_request]
jobs:
build:
name : Build
runs-on : ubuntu-latest
steps:
- uses : actions/checkout@v1
- name : Set up JDK 1.8
uses : actions/setup-java@v1
with:
java-version : 1.8
- name : Cache for maven
uses : actions/cache@v1
with:
path : ~/.m2/repository
key : ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys : |
${{ runner.os }}-maven-
- name : Build with Maven
run : mvn -B package
@ -0,0 +1,43 @@
name : Release CI
on :
push:
branches:
- master
jobs:
build:
name : Build and release
runs-on : ubuntu-latest
if : "!contains(github.event.head_commit.message, '[ci skip]')"
steps:
- uses : actions/checkout@v1
- name : Set up JDK 1.8
uses : actions/setup-java@v1
with:
java-version : 1.8
- name : Setup node 10
uses : actions/setup-node@v1
with:
node-version : '10.x'
- name : Cache for maven
uses : actions/cache@v1
with:
path : ~/.m2/repository
key : ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys : |
${{ runner.os }}-maven-
- name : Cache for npm
uses : actions/cache@v1
with:
path : ~/.npm
key : ${{ runner.os }}-node-${{ hashFiles('.github/workflows/release.yml') }}
restore-keys : |
${{ runner.os }}-node-
- name : Setup semantic-release
run : npm install -g @conveyal/maven-semantic-release semantic-release@15 @semantic-release/exec@v3.3.8
- name : Release
run : semantic-release --use-conveyal-workflow --skip-maven-deploy
env:
GITHUB_TOKEN : ${{ secrets.GH_TOKEN }}
@ -0,0 +1,13 @@
{
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@conveyal/maven-semantic-release",
["@semantic-release/github", {
"assets": [
{"path": "ear/target/*.ear"}
]
}]
]
}
@ -17,10 +17,11 @@ You can get Client ID and Client Secret from the created application.
### Keycloak
1. Open `Themes` setting page in `master` realm. Then set `discord` theme as `Admin Console Theme` . Note: You may need to re-login for reloading the theme.
2. Add `discord` Identity Provider in the realm which you want to configure.
3. In the `discord` identity provider page, set `Client Id` and `Client Secret` .
4. (Optional) Set Guild Id(s) to allow federation if you want.
Note: You don't need to setup the theme in `master` realm from v0.3.0.
1. Add `discord` Identity Provider in the realm which you want to configure.
2. In the `discord` identity provider page, set `Client Id` and `Client Secret` .
3. (Optional) Set Guild Id(s) to allow federation if you want.
## Source Build
@ -3,7 +3,7 @@
<parent >
<groupId > org.keycloak.extensions</groupId>
<artifactId > keycloak-discord-parent</artifactId>
<version > 0.2.0 </version>
<version > 0.2.1-SNAPSHOT </version>
</parent>
<name > Keycloak Discord EAR</name>
@ -3,7 +3,7 @@
<parent >
<groupId > org.keycloak.extensions</groupId>
<artifactId > keycloak-discord-parent</artifactId>
<version > 0.2.0 </version>
<version > 0.2.1-SNAPSHOT </version>
</parent>
<name > Keycloak Discord EJB</name>
@ -34,6 +34,9 @@ public class DiscordIdentityProviderConfig extends OAuth2IdentityProviderConfig
super ( model ) ;
}
public DiscordIdentityProviderConfig ( ) {
}
public String getAllowedGuilds ( ) {
return getConfig ( ) . get ( "allowedGuilds" ) ;
}
@ -17,6 +17,7 @@
package org.keycloak.social.discord ;
import org.keycloak.broker.oidc.OAuth2IdentityProviderConfig ;
import org.keycloak.broker.provider.AbstractIdentityProviderFactory ;
import org.keycloak.broker.social.SocialIdentityProviderFactory ;
import org.keycloak.models.IdentityProviderModel ;
@ -40,6 +41,11 @@ public class DiscordIdentityProviderFactory extends AbstractIdentityProviderFact
return new DiscordIdentityProvider ( session , new DiscordIdentityProviderConfig ( model ) ) ;
}
@Override
public DiscordIdentityProviderConfig createConfig ( ) {
return new DiscordIdentityProviderConfig ( ) ;
}
@Override
public String getId ( ) {
return PROVIDER_ID ;
@ -1,6 +0,0 @@
{
"themes" : [ {
"name" : "discord" ,
"types" : [ "admin" ]
} ]
}
@ -1,2 +0,0 @@
parent=keycloak
@ -7,11 +7,11 @@
<groupId > org.keycloak.extensions</groupId>
<artifactId > keycloak-discord-parent</artifactId>
<version > 0.2.0 </version>
<version > 0.2.1-SNAPSHOT </version>
<packaging > pom</packaging>
<properties >
<version.keycloak > 4.5.0.Final </version.keycloak>
<version.keycloak > 9.0.2 </version.keycloak>
<version.wildfly.maven.plugin > 1.1.0.Final</version.wildfly.maven.plugin>
</properties>