1

我目前正在为 Google SignIn 实施 Shiro-Authentication 和 OAuth。这一切都很好,让我可以根据数据库中的用户电子邮件验证 gmail 帐户。我的构建配置如下所示:

    //User roles and permissions
    compile (":shiro:1.2.0") {
        excludes "servlet-api"
        excludes "shiro-quartz"
    }

    //Google SignIn
    compile ":oauth:2.1.0" 

我遇到的唯一问题是,当谷歌为我的应用程序请求许可时,我得到了这个:在此处输入图像描述

当我期待更像这样的事情时:在此处输入图像描述

它显然仍在使用 OAuth 1.0 而不是 2.0。我在这里阅读了很多问题,我发现最接近的是这个Google 同意屏幕未按预期显示

这个实现的唯一问题是它使用了 Spring 安全性,而我使用的是 Shiro。当我尝试使用 spring 插件时,我在尝试编译它时不断遇到这个问题:

| Error The following artifacts could not be resolved: org.springframework.security:spring-security-core:jar:3.2.0.RC1, org.springframework.security:spring-security-web:jar:3.2.0.RC1: Could not find artifact org.springframework.security:spring-security-core:jar:3.2.0.RC1 in grailsCentral (http://repo.grails.org/grails/plugins)
| Run 'grails dependency-report' for further information.

IDEA hook: Grails not found!
| Error java.lang.NullPointerException
| Error     at org.jetbrains.groovy.grails.rt.Agent$2.run(Agent.java:135)
| Error     at java.lang.Thread.run(Thread.java:695)

非常感谢任何提示或建议。

干杯。

4

1 回答 1

1

I have create a sample grails application that uses oauth plugin for google authentication with oauth2.

Have a try.

I have created a new java file in src/java as suggested here, and using this in my google configurations in Config.groovy.

I have provided the full solution here.

于 2014-05-13T18:33:33.807 回答