JHipster社交登录Google身份验证错误无法发布/登录/谷歌

问题描述 投票:4回答:1

使用JWT和启用社交登录从https://start.jhipster.tech/#/generate-application创建了一个应用程序,从Google生成了clientID,clientSecret并更新了application.yml。

在Google控制台的Web应用程序客户端ID中,授权的JavaScript来源被指定为http://localhost:8080http://localhost:9000

“授权重定向URI”设置为http://localhost:8080/signin/googlehttp://localhost:9000/signin/google

纱线安装,纱线启动和.mvnw(弹簧启动:运行)后,应用程序可以在http://localhost:8080http://localhost:9000运行

当从http://localhost:8080访问应用程序时,使用google登录工作正常,当从http://localhost:9000访问时,社交登录页面显示无法POST / signin / google和浏览器的url更改为http://localhost:9000/signin/google

jhipster spring-social google-openid
1个回答
1
投票

默认情况下,spring social的url未定义到jhipster webpack配置中。

您应该修改文件webpack / webpack.dev.js以将/ signin路径添加到dev服务器配置,如下所示:

devServer: { contentBase: './target/www', proxy: [{ context: [ /* jhipster-needle-add-entity-to-webpack - JHipster will add entity api paths here */ '/api', '/management', '/swagger-resources', '/v2/api-docs', '/h2-console', '/auth', '/signin' ], target: 'http://127.0.0.1:8080', secure: false }], watchOptions: { ignored: /node_modules/ } }

google api credentials中,您应该添加重定向网址:http://localhost:9060/signin/google

© www.soinside.com 2019 - 2024. All rights reserved.