Alfresco使用Google凭据登录

时间:2015-07-07 08:29:15

标签: alfresco alfresco-share google-authentication google-authenticator alfresco-webscripts

我想使用Google凭据登录Alfresco Dashboard。我在下面看过一个示例应用程序。

https://github.com/gdepourtales/share-oauth-sso

但它不适合我。

我正在使用Alfresco 5.0企业版。 我已经下载了项目,我已经按照所有步骤进行了操作

我已经建立了提到并部署了罐子的项目。

我在web.xml文件中添加了以下代码段

<filter>
    <description>Oauth Authentication Support</description>
    <filter-name>OAuthAuthenticationFilter</filter-name>
    <filter-class>ch.gadp.alfresco.OAuthSSOAuthenticationFilter</filter-class>
</filter>

<filter-mapping>
    <filter-name>OAuthAuthenticationFilter</filter-name>
    <url-pattern>/page/*</url-pattern>
</filter-mapping>
<filter-mapping>
    <filter-name>OAuthAuthenticationFilter</filter-name>
    <url-pattern>/p/*</url-pattern>
</filter-mapping>

我在share-config.custom.xml文件中添加了以下配置

<config evaluator="string-compare" condition="OAuthFilter"> <!-- the condition must always be OAuthFilter -->
        <repository>
            <!-- The host of the Alfresco repository webapp -->
            <host>localhost</host>
            <!-- The port of the Alfresco repository webapp. Put 80 for standard HTTP-->
            <port>8081</port>
            <!-- The protocol to access the Alfresco repository -->
            <protocol>http</protocol>
              <!-- The API access URI. If you use standard Alfresco, this should not change -->
            <api>/alfresco/service/api</api>
               <!-- The admin user who is able to create new users -->
            <admin>admin</admin>
            <!-- The password of the admin user -->
            <password>admin</password>
            <!-- The unique password for all users authenticated with OAuth. Choose one very complicated :) -->
            <user-password>gotpxdKFjA_uxzG5SdGu</user-password>
            <!-- The domains for which incoming user should be restricted to. If blank, any valid email will be accepted -->
            <user-domains>nxc.no</user-domains>
        </repository>
        <oauth-api>
            <!-- The key of your API application -->
            <key>my key</key>
            <!-- The URI from which get the user profile informations -->
            <uri>https://www.googleapis.com/oauth2/v1/userinfo</uri>
            <!-- The secret of your API application -->
            <secret>my secret</secret>
            <!-- The scope(s) for getting data -->
            <scope>https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email</scope>
            <!-- This is a constant and my be different in future releases -->
            <name>GoogleApi</name>
        </oauth-api>
    </config>

我启动了服务器,但我没有看到任何变化。

我如何知道用户登录仪表板的过程。因为在露天写的所有内容都是网络脚本,我如何让谷歌用户登录仪表板。

任何答案都会对我有所帮助谢谢!。

2 个答案:

答案 0 :(得分:0)

这些天你想要使用 Google 2 Api 。您的配置中也缺少提示设置。

        <!-- This is a constant and my be different in future releases -->
        <name>Google2Api</name>
        <!-- Whether to re-prompt the user for consent -->
        <prompt>auto</prompt>

答案 1 :(得分:0)

您可以扩展以下项目 - https://github.com/FlexSolution/SocialLogin。它使用oauth2通过使用LinkedIn帐户登录Alfresco

视频的工作原理可在youtube上找到 - https://www.youtube.com/watch?v=4dpueBkL-Jo&index=5&list=PLjxSLwMQLhLifbIIC5qkVio8VoakzncXg