Giter Site home page Giter Site logo

keycloak-dingtalk-social-identity-provider's Introduction

keycloak-dingtalk-social-identity-provider

Keycloak Social Login 插件(IDP) —— 钉钉登陆。

Keycloak HA 部署至 Kubernetes 集群,可参考如下文档:

🔗 GitBook

🔗 CSDN

🔗 掘金

🔗 Notion

🌟 效果

image-20240201173946720

⚙️ 安装

Keycloak 版本 是否支持
23.0.4 ~ 24.0.3
其他

🤖 源码构建

在代码根目录构建 jar 包:

mvn clean install

target 目录下可见 keycloak-dingtalk-social-identity-provider-{version}.jar

将其部署至 Keycloak 的 $KEYCLOAK_HOME/providers 目录中。

Keycloak 默认的 providers 目录为 /opt/keycloak/providers/

🎃 容器部署

🌈 获取容器镜像

这里的镜像是集成了钉钉登陆 IDP 的 keycloak。

方式一 - 自构建

在代码根目录执行:

# 以下方式选其一
# 直接使用 docker
docker build -t keycloak-dingtalk:23.0.4 .

# 使用 buildkit
docker buildx build -f ./Dockerfile --push --platform linux/arm64/v8,linux/amd64 --tag keycloak-dingtalk:23.0.4 .
方式二 - 使用已构建镜像

已事先将容器镜像推送至阿里云,直接拉取使用即可:

docker pull registry.cn-hangzhou.aliyuncs.com/yangsijie666/yangsijie:keycloak-dingtalk-23.0.4

🏵️ 运行容器

执行以下命令:

docker run --name keycloak -e KEYCLOAK_ADMIN=admin -e KEYCLOAK_ADMIN_PASSWORD=admin -p 8080:8080 镜像名 start-dev

访问 http://localhost:8080 即可登陆 Keycloak。

🍾 Kubernetes 部署

在代码根目录,执行以下命令:

kubectl apply -f k8s.yaml

🛠️ 配置

🥙 钉钉

参照钉钉文档在钉钉侧配置用于登陆的应用信息,从钉钉应用中可以获取 clientIdclientSecret 信息。

image-20240201170410565

并在该应用下配置登陆后的 重定向 URL

⚠️ 该配置需等 Keycloak 中配置完 DingTalk 登陆插件后,再配置。

image-20240201170619371

🧀 Keycloak

在目标 Realm(这里) 中选择 Identity Providers,选择 DingTalk

image-20240201171121759

在配置页填入从钉钉侧获取的ClientIdClientSecret

这里的 Redirect URI 即用来复制粘贴进钉钉侧的 重定向 URL

image-20240201171427755

keycloak-dingtalk-social-identity-provider's People

Contributors

yangsijie666 avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.