Skip to content

Commit

Permalink
ConditionalPhoneProvided Negate output set default value
Browse files Browse the repository at this point in the history
  • Loading branch information
cooperlyt committed Aug 9, 2024
1 parent e565da9 commit 83afe06
Show file tree
Hide file tree
Showing 20 changed files with 444 additions and 26 deletions.
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Keycloak (Quarkus 21.x.x) Phone Provider
# Keycloak (Quarkus 25.x.x) Phone Provider - Bate
![Build Status](https://github.com/cooperlyt/keycloak-phone-provider/actions/workflows/compile-and-liveness-check.yml/badge.svg)
![ci](https://github.com/cooperlyt/keycloak-phone-provider/actions/workflows/ci-keycloak20.yml/badge.svg)
![ci](https://github.com/cooperlyt/keycloak-phone-provider/actions/workflows/ci-keycloak21.yml/badge.svg)
Expand All @@ -23,6 +23,7 @@ Currently, there are implementations for:
+ TotalVoice
+ Twilio,
+ YunTongXun SMS
+ WeiXin App grant

More services can be added with ease due to the modularity of the code. In fact, nothing would stop you from implementing a
sender of TTS calls or WhatsApp messages.
Expand Down Expand Up @@ -276,6 +277,20 @@ Set Bind `Reset credentials with phone` to `Reset credentials flow`
+ `Update Phone Number` update user's phone number on next login.
+ `Configure OTP over SMS` update OTP Credential's phone number on next login.

## ** WeiXin APP Grant

Under `Authentication` > `Flows`:
+ Copy the `Direct Grant` flow to `Direct grant weixin app ` flow
+ Click on `Actions` > `Add step` on the `WX APP auth` line and move to first
+ Delete or disable other

Under `Clients` > `$YOUR_CLIENT` > `Advanced` > `Authentication Flow Overrides`
Set Direct Grant Flow to `Direct grant weixin app`


+ `POST /realms/{realmName}/protocol/openid-connect/token`
`Content-Type: application/x-www-form-urlencoded`
`grant_type=password&code=$CODE&client_id=$CLIENT_ID&client_secret=$CLIENT_SECRECT`


**Phone one key login**
Expand Down
2 changes: 1 addition & 1 deletion examples/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ services:


keycloak:
image: coopersoft/keycloak:21.0.1_phone-2.2.2
image: coopersoft/keycloak:25.0.2_phone-2.4.1-snapshot
# restart: always
ports:
- 8080:8080
Expand Down
2 changes: 1 addition & 1 deletion keycloak-phone-provider.resources/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>cc.coopersoft</groupId>
<artifactId>keycloak-phone-provider-parent</artifactId>
<version>2.3.4-snapshot</version>
<version>2.4.1-snapshot</version>
</parent>

<artifactId>keycloak-phone-provider.resources</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion keycloak-phone-provider/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>cc.coopersoft</groupId>
<artifactId>keycloak-phone-provider-parent</artifactId>
<version>2.3.4-snapshot</version>
<version>2.4.1-snapshot</version>
</parent>

<artifactId>keycloak-phone-provider</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public Authenticator create(KeycloakSession session) {
return new AuthenticationCodeAuthenticator(session);
}

private static AuthenticationExecutionModel.Requirement[] REQUIREMENT_CHOICES = {
private static final AuthenticationExecutionModel.Requirement[] REQUIREMENT_CHOICES = {
AuthenticationExecutionModel.Requirement.REQUIRED,
// AuthenticationExecutionModel.Requirement.DISABLED
};
Expand Down
4 changes: 2 additions & 2 deletions keycloak-sms-provider-aliyun/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>keycloak-phone-provider-parent</artifactId>
<groupId>cc.coopersoft</groupId>
<version>2.3.4-snapshot</version>
<version>2.4.1-snapshot</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand All @@ -16,7 +16,7 @@
<dependency>
<groupId>cc.coopersoft</groupId>
<artifactId>keycloak-phone-provider</artifactId>
<version>2.3.4-snapshot</version>
<version>2.4.1-snapshot</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down
4 changes: 2 additions & 2 deletions keycloak-sms-provider-aws-sns/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>cc.coopersoft</groupId>
<artifactId>keycloak-phone-provider-parent</artifactId>
<version>2.3.4-snapshot</version>
<version>2.4.1-snapshot</version>
</parent>

<artifactId>keycloak-sms-provider-aws-sns</artifactId>
Expand All @@ -16,7 +16,7 @@
<dependency>
<groupId>cc.coopersoft</groupId>
<artifactId>keycloak-phone-provider</artifactId>
<version>2.3.4-snapshot</version>
<version>2.4.1-snapshot</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down
4 changes: 2 additions & 2 deletions keycloak-sms-provider-bulksms/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>cc.coopersoft</groupId>
<artifactId>keycloak-phone-provider-parent</artifactId>
<version>2.3.4-snapshot</version>
<version>2.4.1-snapshot</version>
</parent>

<artifactId>keycloak-sms-provider-bulksms</artifactId>
Expand All @@ -16,7 +16,7 @@
<dependency>
<groupId>cc.coopersoft</groupId>
<artifactId>keycloak-phone-provider</artifactId>
<version>2.3.4-snapshot</version>
<version>2.4.1-snapshot</version>
<scope>provided</scope>
</dependency>
</dependencies>
Expand Down
4 changes: 2 additions & 2 deletions keycloak-sms-provider-cloopen/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>cc.coopersoft</groupId>
<artifactId>keycloak-phone-provider-parent</artifactId>
<version>2.3.4-snapshot</version>
<version>2.4.1-snapshot</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand All @@ -15,7 +15,7 @@
<dependency>
<groupId>cc.coopersoft</groupId>
<artifactId>keycloak-phone-provider</artifactId>
<version>2.3.4-snapshot</version>
<version>2.4.1-snapshot</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down
4 changes: 2 additions & 2 deletions keycloak-sms-provider-dummy/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>cc.coopersoft</groupId>
<artifactId>keycloak-phone-provider-parent</artifactId>
<version>2.3.4-snapshot</version>
<version>2.4.1-snapshot</version>
</parent>

<artifactId>keycloak-sms-provider-dummy</artifactId>
Expand All @@ -16,7 +16,7 @@
<dependency>
<groupId>cc.coopersoft</groupId>
<artifactId>keycloak-phone-provider</artifactId>
<version>2.3.4-snapshot</version>
<version>2.4.1-snapshot</version>
<scope>provided</scope>
</dependency>
</dependencies>
Expand Down
4 changes: 2 additions & 2 deletions keycloak-sms-provider-tencent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>keycloak-phone-provider-parent</artifactId>
<groupId>cc.coopersoft</groupId>
<version>2.3.4-snapshot</version>
<version>2.4.1-snapshot</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand All @@ -16,7 +16,7 @@
<dependency>
<groupId>cc.coopersoft</groupId>
<artifactId>keycloak-phone-provider</artifactId>
<version>2.3.4-snapshot</version>
<version>2.4.1-snapshot</version>
<scope>provided</scope>
</dependency>

Expand Down
4 changes: 2 additions & 2 deletions keycloak-sms-provider-totalvoice/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>cc.coopersoft</groupId>
<artifactId>keycloak-phone-provider-parent</artifactId>
<version>2.3.4-snapshot</version>
<version>2.4.1-snapshot</version>
</parent>

<artifactId>keycloak-sms-provider-totalvoice</artifactId>
Expand All @@ -16,7 +16,7 @@
<dependency>
<groupId>cc.coopersoft</groupId>
<artifactId>keycloak-phone-provider</artifactId>
<version>2.3.4-snapshot</version>
<version>2.4.1-snapshot</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down
4 changes: 2 additions & 2 deletions keycloak-sms-provider-twilio/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>cc.coopersoft</groupId>
<artifactId>keycloak-phone-provider-parent</artifactId>
<version>2.3.4-snapshot</version>
<version>2.4.1-snapshot</version>
</parent>

<artifactId>keycloak-sms-provider-twilio</artifactId>
Expand All @@ -16,7 +16,7 @@
<dependency>
<groupId>cc.coopersoft</groupId>
<artifactId>keycloak-phone-provider</artifactId>
<version>2.3.4-snapshot</version>
<version>2.4.1-snapshot</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down
4 changes: 2 additions & 2 deletions keycloak-sms-provider-twofactorapi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>cc.coopersoft</groupId>
<artifactId>keycloak-phone-provider-parent</artifactId>
<version>2.3.4-snapshot</version>
<version>2.4.1-snapshot</version>
</parent>

<artifactId>keycloak-sms-provider-twofactorapi</artifactId>
Expand All @@ -16,7 +16,7 @@
<dependency>
<groupId>cc.coopersoft</groupId>
<artifactId>keycloak-phone-provider</artifactId>
<version>2.3.4-snapshot</version>
<version>2.4.1-snapshot</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down
4 changes: 2 additions & 2 deletions keycloak-sms-provider-yunxin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>keycloak-phone-provider-parent</artifactId>
<groupId>cc.coopersoft</groupId>
<version>2.3.4-snapshot</version>
<version>2.4.1-snapshot</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand All @@ -15,7 +15,7 @@
<dependency>
<groupId>cc.coopersoft</groupId>
<artifactId>keycloak-phone-provider</artifactId>
<version>2.3.4-snapshot</version>
<version>2.4.1-snapshot</version>
<scope>provided</scope>
</dependency>

Expand Down
75 changes: 75 additions & 0 deletions keycloak-wx-provider-app/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>cc.coopersoft</groupId>
<artifactId>keycloak-phone-provider-parent</artifactId>
<version>2.4.1-snapshot</version>
</parent>

<artifactId>keycloak-wx-provider-app</artifactId>

<properties>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencies>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>4.12.0</version>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<finalName>${project.build.finalName}</finalName>
<appendAssemblyId>false</appendAssemblyId>
</configuration>
</plugin>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>${project.groupId}</groupId>
<artifactId>${project.artifactId}</artifactId>
<version>${project.version}</version>
</artifactItem>
</artifactItems>
<outputDirectory>../target/providers</outputDirectory>
<stripClassifier>true</stripClassifier>
<stripVersion>true</stripVersion>
</configuration>
</execution>
</executions>
</plugin>

</plugins>
</build>

</project>
Loading

0 comments on commit 83afe06

Please sign in to comment.