Skip to content

Commit

Permalink
fix: add utf 8 to maven plugin so that chinese weixin name is display…
Browse files Browse the repository at this point in the history
…ed correctly
  • Loading branch information
Jeff Tian@Workstation committed Sep 10, 2022
1 parent 8069d7b commit c119bd5
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 24 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM quay.io/keycloak/keycloak:18.0.2

COPY target/keycloak-services-social-weixin-0.1.0.jar /opt/keycloak/providers/
COPY target/keycloak-services-social-weixin-0.1.1.jar /opt/keycloak/providers/

CMD ["start-dev", "--hostname-strict=false"]
5 changes: 5 additions & 0 deletions Dockerfile.19
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM quay.io/keycloak/keycloak:latest

COPY target/keycloak-services-social-weixin-0.1.1.jar /opt/keycloak/providers/

CMD ["start-dev", "--hostname-strict=false"]
14 changes: 14 additions & 0 deletions docker-compose.19.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: '3'

services:
keycloak:
build:
context: .
dockerfile: Dockerfile.19
environment:
KEYCLOAK_ADMIN: admin
KEYCLOAK_ADMIN_PASSWORD: admin
ports:
- "8080:8080"
command:
- start-dev
9 changes: 8 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-services-social-weixin</artifactId>
<version>0.1.0</version>
<version>0.1.1</version>
<name>Keycloak Services Social WeiXin</name>
<description/>
<properties>
Expand All @@ -27,6 +27,7 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<encoding>UTF-8</encoding>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
</configuration>
Expand Down Expand Up @@ -99,5 +100,11 @@
<artifactId>gson</artifactId>
<version>2.9.0</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
<version>4.4.15</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
1 change: 0 additions & 1 deletion src/main/java/org/keycloak/social/weixin/JsonResponse.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package org.keycloak.social.weixin;

import org.apache.http.HttpResponse;
import javax.ws.rs.core.Response;

public class JsonResponse {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ private Response finishBrokerAuthentication(BrokeredIdentityContext context, Use
final AuthenticationSessionManager authenticationSessionManager = new AuthenticationSessionManager(session);
UserSessionModel userSession = authenticationSessionManager.getUserSession(authSession);

if(userSession == null){
if (userSession == null) {
userSession = WMPHelper.getUserSessionModel(context, federatedUser, authSession);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
import org.keycloak.broker.provider.AuthenticationRequest;
import org.keycloak.broker.provider.BrokeredIdentityContext;
import org.keycloak.broker.provider.IdentityBrokerException;
import org.keycloak.broker.provider.util.IdentityBrokerState;
import org.keycloak.broker.provider.util.SimpleHttp;
import org.keycloak.broker.social.SocialIdentityProvider;
import org.keycloak.common.ClientConnection;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,29 +1,10 @@
/*
* Copyright 2016 Red Hat, Inc. and/or its affiliates
* and other contributors as indicated by the @author tags.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.keycloak.social.weixin;

import org.keycloak.broker.provider.AbstractIdentityProviderFactory;
import org.keycloak.models.IdentityProviderModel;
import org.keycloak.broker.social.SocialIdentityProviderFactory;
import org.keycloak.models.KeycloakSession;

/**
* @author yong.jiang
*/
public class WeiXinIdentityProviderFactory extends AbstractIdentityProviderFactory<WeiXinIdentityProvider>
implements SocialIdentityProviderFactory<WeiXinIdentityProvider> {

Expand Down

0 comments on commit c119bd5

Please sign in to comment.