使用Identity Server

时间:2016-11-09 10:29:25

标签: google-api wso2 wso2is wso2-am wso2carbon

我使用How To Setup a WSO2 API Manager Store Login with Google文章来配置Google对WSO2 API Manager Store的登录可能性,但我遇到了问题。

似乎一切正常,但我无法通过Google登录到商店。

  1. 通过配置自动创建用户。

  2. 点击登录后,我猜用户正在登录自动存储和注销,可能是因为没有权限/角色登录或其他。

  3. 如何在Google点击登录后自动为用户创建分配一些权限/角色?

    也许问题在其他方面?

    编辑:

    1. 登录API Manager:
    2.   

      TID:[ - 1234] [] [2016-11-09 12:57:52,746]警告   {org.apache.tomcat.jdbc.pool.ConnectionPool} - maxIdle大于   maxActive,将maxIdle设置为:40   {org.apache.tomcat.jdbc.pool.ConnectionPool}

           

      TID:[ - 1234] [] [2016-11-09 12:57:53,486] WARN {org.apache.tomcat.jdbc.pool.ConnectionPool} - maxIdle大于   maxActive,将maxIdle设置为:40   {org.apache.tomcat.jdbc.pool.ConnectionPool}

           

      TID:[ - 1234] [] [2016-11-09 12:57:58,650] WARN {org.apache.tomcat.jdbc.pool.ConnectionPool} - maxIdle大于   maxActive,将maxIdle设置为:40   {org.apache.tomcat.jdbc.pool.ConnectionPool}

           

      TID:[ - 1234] [] [2016-11-09 12:58:23,672] ERROR {org.wso2.carbon.core.internal.permission.update.PermissionUpdater} -   更新租户的权限缓存时出错:-1   {} org.wso2.carbon.core.internal.permission.update.PermissionUpdater       显示java.lang.NullPointerException         at org.wso2.carbon.registry.core.jdbc.realm.RegistryRealm.getRealm(RegistryRealm.java:148)         在org.wso2.carbon.core.internal.permission.update.PermissionUpdater.getAuthzManager(PermissionUpdater.java:90)         在org.wso2.carbon.core.internal.permission.update.PermissionUpdater.update(PermissionUpdater.java:60)         at org.wso2.carbon.core.util.PermissionUpdateUtil.updatePermissionTree(PermissionUpdateUtil.java:46)         at org.wso2.carbon.apimgt.hostobjects.APIStoreHostObject.jsFunction_updatePermissionCache(APIStoreHostObject.java:743)         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)         在java.lang.reflect.Method.invoke(Method.java:483)         在org.mozilla.javascript.MemberBox.invoke(MemberBox.java:126)         在org.mozilla.javascript.FunctionObject.call(FunctionObject.java:386)         在org.mozilla.javascript.optimizer.OptRuntime.call1(OptRuntime.java:32)         在org.jaggeryjs.rhino.store.modules.api.c2._c_anonymous_3(/store/modules/api/permissions.jag:63)         在org.jaggeryjs.rhino.store.modules.api.c2.call(/store/modules/api/permissions.jag)         在org.mozilla.javascript.ScriptRuntime.applyOrCall(ScriptRuntime.java:2430)         在org.mozilla.javascript.BaseFunction.execIdCall(BaseFunction.java:269)         在org.mozilla.javascript.IdFunctionObject.call(IdFunctionObject.java:97)         在org.mozilla.javascript.optimizer.OptRuntime.call2(OptRuntime.java:42)         在org.jaggeryjs.rhino.store.modules.api.c0._c_anonymous_14(/store/modules/api/module.jag:48)         在org.jaggeryjs.rhino.store.modules.api.c0.call(/store/modules/api/module.jag)         在org.mozilla.javascript.optimizer.OptRuntime.call1(OptRuntime.java:32)         在org.jaggeryjs.rhino.store.jagg.c1._c_anonymous_1(/store/jagg/jaggery_acs.jag:89)         在org.jaggeryjs.rhino.store.jagg.c1.call(/store/jagg/jaggery_acs.jag)         在org.mozilla.javascript.optimizer.OptRuntime.call0(OptRuntime.java:23)         在org.jaggeryjs.rhino.store.jagg.c1._c_script_0(/store/jagg/jaggery_acs.jag:5)         在org.jaggeryjs.rhino.store.jagg.c1.call(/store/jagg/jaggery_acs.jag)         在org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:394)         在org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3091)         在org.jaggeryjs.rhino.store.jagg.c1.call(/store/jagg/jaggery_acs.jag)         在org.jaggeryjs.rhino.store.jagg.c1.exec(/store/jagg/jaggery_acs.jag)         at org.jaggeryjs.scriptengine.engine.RhinoEngine.execScript(RhinoEngine.java:567)         在org.jaggeryjs.scriptengine.engine.RhinoEngine.exec(RhinoEngine.java:273)         在org.jaggeryjs.jaggery.core.manager.WebAppManager.exec(WebAppManager.java:588)         在org.jaggeryjs.jaggery.core.manager.WebAppManager.execute(WebAppManager.java:508)         在org.jaggeryjs.jaggery.core.JaggeryServlet.doPost(JaggeryServlet.java:29)         在javax.servlet.http.HttpServlet.service(HttpServlet.java:650)         在javax.servlet.http.HttpServlet.service(HttpServlet.java:731)         在org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)         在org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)         在org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:747)         在org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:485)         在org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:377)         在org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:337)         在org.jaggeryjs.jaggery.core.JaggeryFilter.doFilter(JaggeryFilter.java:21)         在org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)         在org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)         在org.apache.catalina.filters.HttpHeaderSecurityFilter.doFilter(HttpHeaderSecurityFilter.java:120)         在org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)         在org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)         在org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)         在org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)         在org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)         在org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)         在org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)         at org.wso2.carbon.tomcat.ext.valves.CompositeValve.continueInvocation(CompositeValve.java:99)         at org.wso2.carbon.tomcat.ext.valves.CarbonTomcatValve $ 1.invoke(CarbonTomcatValve.java:47)         在org.wso2.carbon.webapp.mgt.TenantLazyLoaderValve.invoke(TenantLazyLoaderValve.java:57)         在org.wso2.carbon.event.receiver.core.internal.tenantmgt.TenantLazyLoaderValve.invoke(TenantLazyLoaderValve.java:48)         at org.wso2.carbon.tomcat.ext.valves.TomcatValveContainer.invokeValves(TomcatValveContainer.java:47)         在org.wso2.carbon.tomcat.ext.valves.CompositeValve.invoke(CompositeValve.java:62)         at org.wso2.carbon.tomcat.ext.valves.CarbonStuckThreadDetectionValve.invoke(CarbonStuckThreadDetectionValve.java:159)         在org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956)         at org.wso2.carbon.tomcat.ext.valves.CarbonContextCreatorValve.invoke(CarbonContextCreatorValve.java:57)         在org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)         在org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:436)         在org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1078)         at org.apache.coyote.AbstractProtocol $ AbstractConnectionHandler.process(AbstractProtocol.java:625)         在org.apache.tomcat.util.net.NioEndpoint $ SocketProcessor.doRun(NioEndpoint.java:1749)         at org.apache.tomcat.util.net.NioEndpoint $ SocketProcessor.run(NioEndpoint.java:1708)         在java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)         at java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:617)         at org.apache.tomcat.util.threads.TaskThread $ WrappingRunnable.run(TaskThread.java:61)         在java.lang.Thread.run(Thread.java:745)

           

      TID:[ - 1234] [] [2016-11-09 12:58:24,029] INFO {org.wso2.carbon.hostobjects.sso.SAMLSSORelyingPartyObject} -   invalidate:会话已经失效   {org.wso2.carbon.hostobjects.sso.SAMLSSORelyingPartyObject}

           

      TID:[ - 1234] [] [2016-11-09 12:58:31,931] WARN {org.apache.tomcat.jdbc.pool.ConnectionPool} - maxIdle大于   maxActive,将maxIdle设置为:40   {org.apache.tomcat.jdbc.pool.ConnectionPool}

           

      TID:[ - 1234] [] [2016-11-09 12:58:34,634] WARN {org.apache.tomcat.jdbc.pool.ConnectionPool} - maxIdle大于   maxActive,将maxIdle设置为:40   {org.apache.tomcat.jdbc.pool.ConnectionPool}

      1. 登录Identity Server:
      2.   

        TID:[ - 1234] [] [2016-11-09 12:57:42,762]警告   {org.apache.tomcat.jdbc.pool.ConnectionPool} - maxIdle大于   maxActive,将maxIdle设置为:40 TID:[ - 1234] [] [2016-11-09   12:58:04,670] INFO {org.wso2.carbon.identity.oauth2.dao.TokenMgtDAO}

             
            
        • 会话持久消费者的线程池大小:100 TID:[ - 1234] [] [2016-11-09 12:58:04,986] INFO   {org.wso2.carbon.identity.entitlement.policy.finder.CarbonPolicyFinder}

        •   
        • 政策商店的初始化开始于:11月9日星期三12:58:04 CET 2016 TID:[ - 1234] [] [2016-11-09 12:58:04,993]信息   {org.wso2.carbon.identity.entitlement.policy.store.DefaultPolicyDataStore}

        •   
        • 使用配置文件中定义的全局策略组合算法。 TID:[ - 1234] [] [2016-11-09 12:58:04,993]信息   {org.wso2.carbon.identity.entitlement.policy.finder.CarbonPolicyFinder}

        •   
        • 开始从org.wso2.carbon.identity.entitlement.policy.store.RegistryPolicyStoreManageModule@2f8601e6检索政策   at:Wed Nov 09 12:58:04 CET 2016 TID:[ - 1234] [] [2016-11-09   12:58:04,995]信息   {org.wso2.carbon.identity.entitlement.policy.finder.CarbonPolicyFinder}

        •   
        • 完成从org.wso2.carbon.identity.entitlement.policy.store.RegistryPolicyStoreManageModule@2f8601e6检索政策   at:Wed Nov 09 12:58:04 CET 2016 TID:[ - 1234] [] [2016-11-09   12:58:04,996]信息   {org.wso2.carbon.identity.entitlement.policy.finder.CarbonPolicyFinder}
        •   
        • 政策商店的初始化结束于:Wed Nov 09 12:58:04 CET 2016 TID:[ - 1234] [] [2016-11-09 12:58:05,035] INFO   {org.wso2.carbon.identity.entitlement.policy.finder.CarbonPolicyFinder}
        •   
        • 政策商店的初始化开始于:11月9日星期三12:58:05 CET 2016 TID:[ - 1234] [] [2016-11-09 12:58:05,036] INFO   {org.wso2.carbon.identity.entitlement.policy.store.DefaultPolicyDataStore}
        •   
        • 使用配置文件中定义的全局策略组合算法。 TID:[ - 1234] [] [2016-11-09 12:58:05,037]信息   {org.wso2.carbon.identity.entitlement.policy.finder.CarbonPolicyFinder}
        •   
        • 开始从org.wso2.carbon.identity.entitlement.policy.store.RegistryPolicyStoreManageModule@2f8601e6检索政策   at:Wed Nov 09 12:58:05 CET 2016 TID:[ - 1234] [] [2016-11-09   12:58:05,039]信息   {org.wso2.carbon.identity.entitlement.policy.finder.CarbonPolicyFinder}
        •   
        • 完成从org.wso2.carbon.identity.entitlement.policy.store.RegistryPolicyStoreManageModule@2f8601e6检索政策   at:Wed Nov 09 12:58:05 CET 2016 TID:[ - 1234] [] [2016-11-09   12:58:05,039]信息   {org.wso2.carbon.identity.entitlement.policy.finder.CarbonPolicyFinder}
        •   
        • 政策商店的初始化完成于:11月9日星期三12:58:05 CET 2016 TID:[ - 1234] [] [2016-11-09 12:58:22,983] INFO   {org.wso2.carbon.core.internal.permission.update.PermissionUpdater} -   为租户-1234
        • 更新了权限缓存   
        1. 我的服务提供商和身份提供商的配置如下所示:
        2. Service Provider 1

          Service Provider 2

          Service Provider 3

          Identity Provider 1

          Identity Provider 2

1 个答案:

答案 0 :(得分:0)

故事的结尾:

我应该使用文章Setting up PostgreSQL,尤其是Changing the default WSO2_CARBON_DB datasource,将默认数据库更改为API Manager和Identity Server中的PostgreSQL数据库,并使用-Dserver选项[For Windows: <PRODUCT_HOME>/bin/wso2server.bat -Dsetup]运行服务器。

在完成所有配置后,我将权限API/SubscribeLogin添加到Internal/everyone角色。

Bhathiya,谢谢你的帮助。 :)