plugin-oauth2 icon indicating copy to clipboard operation
plugin-oauth2 copied to clipboard

Halo 2.0 的 OAuth2 第三方登录插件。

Results 20 plugin-oauth2 issues
Sort by recently updated
recently updated
newest added

后续考虑新增其它登陆方式吗,比如像微信QQ之类的

在 halo 主仓库已反馈,由于不确定该问题是角色配置问题,还是插件调用问题 [https://github.com/halo-dev/halo/issues/6485](https://github.com/halo-dev/halo/issues/6485)

What this PR does? 支持 Gitea 第三方登录,包括社区版自建应用 ```release-note 支持 Gitea 第三方登录,包括社区版自建应用 ```

release-note

## 关于 回调地址 的提示 ![image](https://github.com/user-attachments/assets/ac079e15-600e-481a-9491-2d70bc2c2b3a) ## 关于 登录按钮 的自定义 更建议让用户决定登录按钮的显示内容,已默认值保底程序正常运行。 ![image](https://github.com/user-attachments/assets/fe352978-2605-4278-b73e-f024ee553164) 仅仅是一些建议 Gitea (Open Source) 其实已经支持很多使用 Oauth2 应用的程序,只要表单足够标准化。 _Originally posted by @QYG2297248353 in https://github.com/halo-sigs/plugin-oauth2/issues/55#issuecomment-2264636909_

```java [c3e5d8de-4343] 500 Server Error for HTTP GET "/login/oauth2/code/shenji?code=sZgylY&state=CVR7a4iSL4A9ia-Z_BML-St-JbyX4-0dDd15aAqlhEA%3D" java.lang.IllegalStateException: No provider found for class org.springframework.security.oauth2.client.authentication.OAuth2AuthorizationCodeAuthenticationToken at org.springframework.security.web.server.authentication.AuthenticationWebFilter.lambda$authenticate$6(AuthenticationWebFilter.java:124) ~[spring-security-web-6.3.1.jar:6.3.1] Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException: Error has been observed at the following site(s): *__checkpoint...

你好, 我在个人博客(https://rsps.myds.me:444,Halo 2.17.1)上安装了 OAuth 2(1.2.0),按照ReadMe正确创建了Gitee应用并配置了client_id和secret,截图如下: ![IMG_0009](https://github.com/halo-sigs/plugin-oauth2/assets/88028845/b87d775e-2458-4c74-8ff1-47e5c9a04925) ![IMG_0010](https://github.com/halo-sigs/plugin-oauth2/assets/88028845/aa683d01-f1af-4ead-abc9-9ed242d52fa9) 但在尝试绑定账号时,提示回调地址无效: ![IMG_0011](https://github.com/halo-sigs/plugin-oauth2/assets/88028845/be023163-fe10-46dc-b39a-7779a1ea5266) 附带日志如下: [halo-log-2024-07-10 15_49.log](https://github.com/user-attachments/files/16157682/halo-log-2024-07-10.15_49.log) 麻烦查看一下,谢谢 ============================= PS:我似乎发现redirect_uri参数中端口号丢了。手动加上后正常弹出请求页面,但点击同意授权后页面重定向到”/login?error”,登录仍不成功。

为 AuthProviders 添加 authType 字段。 ```release-note 为 AuthProviders 添加 authType 字段。 ```

release-note

我是用 docker-compose 啟動的, docker-compose.yml 內容如下 ``` services: halo: #image: registry.fit2cloud.com/halo/halo:2.20 image: registry.fit2cloud.com/halo/halo:2.20.18 restart: on-failure:3 depends_on: halodb: condition: service_healthy networks: halo_network: volumes: - ./halo2:/root/.halo2 ports: - "8090:8090" healthcheck: test: ["CMD", "curl",...

目前使用 OAuth 登录之后需要绑定用户或者注册并绑定,这会比较繁琐。个人认为 OAuth 应该首要保证快捷,所以建议提供开启自动创建账号的选项,支持用户使用 OAuth 授权之后无需再注册账号。但可能需要考虑几个问题: 1. 用户名,来源建议是 OAuth Server 提供的用户名,比如 GitHub username,但需要考虑命名规则是否有差异。 2. 密码,自动创建账号如果不设置密码,那么后续可能无法修改密码(修改密码需要旧密码验证),个人建议通过 OAuth 注册之后可以跳转到完善密码的页面。

在认证方式详情页显示对应认证方式的回调地址。 这样在GitHub、Gitee等其他平台注册应用时不再需要访问仓库看Readme才能找到回调地址了,更方便一点。

kind/improvement