使用OAuth2 Google Extension for Geoserver,Geoserver主页不会重定向到Google登录页面 [英] With Oauth2 Google Extension for Geoserver, GeoServer home page does not redirect to Google Login page

查看:30
本文介绍了使用OAuth2 Google Extension for Geoserver,Geoserver主页不会重定向到Google登录页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已成功安装了Geoserver的OAuth2扩展,并且能够创建身份验证筛选器并将Google_OAuth2添加到筛选器链Web 休息 GWC 默认

我还创建了信任库,并将其作为../cacerts.cks添加到JAVA_OPTS路径

我遵循的所有步骤都与官方docs

相同

现在,当我按照文档的指示导航到Geoserver主页时,我无法获得应有的Google登录页面。

我发现的一个问题是,在将Google-OAuth2添加到筛选器链后,当我以Geoserver管理员身份注销时,Google-OAuth再次从所选链中删除。

我想知道的是如何进行逐步检查以确定此问题的根本原因。 任何帮助都将不胜感激。

我有谷歌登录图标,当我点击它时,我得到了关于此URL http://:8080/geoserver/web/j_spring_oauth2_google_login

的404错误

这是日志文件,我在这里找不到任何指向问题的东西,只有一些与身份验证无关的警告

04 Jul 15:08:00 DEBUG [geoserver.global] - Found Java environment variable GEOSERVER_DATA_DIR to be unset
    04-Jul-2017 15:08:00.911 WARNING [localhost-startStop-1] org.geoserver.platform.GeoServerExtensions.checkContext Extension lookup 'XStreamPersisterInitializer', but ApplicationContext is unset.
    04-Jul-2017 15:08:00.912 WARNING [localhost-startStop-1] org.geoserver.platform.GeoServerExtensions.checkContext Extension lookup 'ExtensionFilter', but ApplicationContext is unset.
    04-Jul-2017 15:08:00.914 WARNING [localhost-startStop-1] org.geoserver.platform.GeoServerExtensions.checkContext Extension lookup 'ExtensionProvider', but ApplicationContext is unset.
    04-Jul-2017 15:08:00.914 WARNING [localhost-startStop-1] org.geoserver.platform.GeoServerExtensions.checkContext Extension lookup 'ExtensionFilter', but ApplicationContext is unset.
    log4j:WARN File option not set for appender [geoserverlogfile].
    log4j:WARN Are you using FileAppender instead of ConsoleAppender?
    04-Jul-2017 15:08:03.435 WARNING [localhost-startStop-1] org.geoserver.platform.GeoServerExtensions.checkContext Extension lookup 'GeoServerSecurityProvider', but ApplicationContext is unset.
    04-Jul-2017 15:08:03.435 WARNING [localhost-startStop-1] org.geoserver.platform.GeoServerExtensions.checkContext Extension lookup 'ExtensionFilter', but ApplicationContext is unset.
    04-Jul-2017 15:08:03.435 WARNING [localhost-startStop-1] org.geoserver.platform.GeoServerExtensions.checkContext Extension lookup 'ExtensionProvider', but ApplicationContext is unset.
    04-Jul-2017 15:08:03.435 WARNING [localhost-startStop-1] org.geoserver.platform.GeoServerExtensions.checkContext Extension lookup 'ExtensionFilter', but ApplicationContext is unset.
    04 Jul 15:08:04 INFO [config.GeoServerPropertyConfigurer] - Loading properties file from org.geoserver.config.SpringResourceAdaptor@6653368c
    04 Jul 15:08:04 INFO [geoserver.monitor] - Configuring monitoring database from: monitoring/db.properties
    04 Jul 15:08:04 WARN [impl.SessionFactoryObjectFactory] - InitialContext did not implement EventContext
<Loaded smth........>
    04 Jul 15:08:07 INFO [config.GeoserverXMLResourceProvider] - Will look for 'geowebcache.xml' in directory '/var/lib/geoserver_data/gwc'.
    04 Jul 15:08:07 INFO [config.GeoserverXMLResourceProvider] - Found configuration file in gwc
    04 Jul 15:08:07 INFO [config.GeoserverXMLResourceProvider] - Found configuration file in gwc
    04 Jul 15:08:07 INFO [config.GeoserverXMLResourceProvider] - Found configuration file in gwc
    04 Jul 15:08:07 WARN [config.XMLConfiguration] - ********************************************************************************
    04 Jul 15:08:07 WARN [config.XMLConfiguration] - *** GWC configuration validation error: cvc-elt.1: Cannot find the declaration of element 'gwcConfiguration'.
    04 Jul 15:08:07 WARN [config.XMLConfiguration] - *** Will try to use configuration anyway. Please check the order of declared elements against the schema.
    04 Jul 15:08:07 WARN [config.XMLConfiguration] - ********************************************************************************
    04 Jul 15:08:07 INFO [gwc.layer] - Initializing GWC configuration based on GeoServer's Catalog
    04 Jul 15:08:07 INFO [gwc.layer] - GeoServer TileLayer store base directory is: gwc-layers
    04 Jul 15:08:07 INFO [gwc.layer] - Loading tile layers from gwc-layers
    04 Jul 15:08:07 INFO [config.XMLConfiguration] - Initializing GridSets from gwc
    04 Jul 15:08:07 INFO [config.XMLConfiguration] - Initializing layers from gwc
    04 Jul 15:08:07 INFO [layer.TileLayerDispatcher] - Configuration gwc contained no layers.
    04 Jul 15:08:07 INFO [storage.DefaultStorageFinder] - **************************************************************************************************************************
    04 Jul 15:08:07 INFO [storage.DefaultStorageFinder] - *** Found Servlet context parameter GEOSERVER_DATA_DIR set to /var/lib/geoserver_data, using it as the default prefix. ***
    04 Jul 15:08:07 INFO [storage.DefaultStorageFinder] - **************************************************************************************************************************
    04 Jul 15:08:07 INFO [config.GeoserverXMLResourceProvider] - Will look for 'geowebcache-diskquota.xml' in directory '/var/lib/geoserver_data/gwc'.
    04 Jul 15:08:07 INFO [config.GeoserverXMLResourceProvider] - Will look for 'geowebcache-diskquota-jdbc.xml' in directory '/var/lib/geoserver_data/gwc'.
    04 Jul 15:08:07 INFO [config.GeoserverXMLResourceProvider] - Found configuration file in gwc
    04 Jul 15:08:07 INFO [diskquota.ConfigLoader] - Quota config is: gwc/geowebcache-diskquota.xml
    04 Jul 15:08:07 INFO [config.GeoserverXMLResourceProvider] - Found configuration file in gwc
    04 Jul 15:08:09 INFO [config.GeoserverXMLResourceProvider] - Found configuration file in gwc
    04 Jul 15:08:09 INFO [diskquota.ConfigLoader] - Quota config is: gwc/geowebcache-diskquota.xml
    04 Jul 15:08:09 INFO [config.GeoserverXMLResourceProvider] - Found configuration file in gwc
    04 Jul 15:08:09 INFO [diskquota.DiskQuotaMonitor] - Setting up disk quota periodic enforcement task
    04 Jul 15:08:09 INFO [diskquota.DiskQuotaMonitor] - 0 layers configured with their own quotas.
    04 Jul 15:08:09 INFO [diskquota.DiskQuotaMonitor] - 24 layers attached to global quota 500.0 MB
    04 Jul 15:08:09 INFO [diskquota.DiskQuotaMonitor] - Disk quota periodic enforcement task set up every 30 SECONDS
    04 Jul 15:08:10 INFO [org.geoserver] - Loaded service 'WPSInfoImpl--ecf5ed2:15cf44cc45b:-8000', enabled
    04 Jul 15:08:10 INFO [org.geoserver] - Loaded service 'wcs', enabled
    04 Jul 15:08:10 INFO [org.geoserver] - Loaded service 'WMTSInfoImpl--387a6a83:15d0d802c5c:-8000', enabled
    04 Jul 15:08:10 INFO [org.geoserver] - Loaded service 'wms', enabled
    04 Jul 15:08:10 INFO [org.geoserver] - Loaded service 'wfs', enabled
    04 Jul 15:08:10 INFO [org.geoserver] - Loaded service 'WPSInfoImpl-2db12f5c:15cf83a5f1b:-7fdb', enabled
    04 Jul 15:08:10 INFO [org.geoserver] - Loaded service 'WCSInfoImpl-2db12f5c:15cf83a5f1b:-7fdc', enabled
    04 Jul 15:08:10 INFO [org.geoserver] - Loaded service 'WMTSInfoImpl-2db12f5c:15cf83a5f1b:-7fdf', enabled
    04 Jul 15:08:10 INFO [org.geoserver] - Loaded service 'WMSInfoImpl-2db12f5c:15cf83a5f1b:-7fde', enabled
    04 Jul 15:08:10 INFO [org.geoserver] - Loaded service 'WFSInfoImpl-2db12f5c:15cf83a5f1b:-7fdd', enabled
    04 Jul 15:08:10 INFO [geoserver.monitor] - Monitor hibernate extension enabled
    04 Jul 15:08:10 INFO [gwc.config] - Initializing GeoServer specific GWC configuration from gwc-gs.xml
    04 Jul 15:08:11 INFO [ows.OWSHandlerMapping] - Mapped URL path [/wps] onto handler 'dispatcher'
    04 Jul 15:08:11 INFO [ows.OWSHandlerMapping] - Mapped URL path [/wps/*] onto handler 'dispatcher'
    04 Jul 15:08:11 INFO [ows.OWSHandlerMapping] - Mapped URL path [/temp/**] onto handler 'filePublisher'
    04 Jul 15:08:11 INFO [geoserver.wps] - Found 89 bindable processes in Deprecated processes
    04 Jul 15:08:11 INFO [geoserver.wps] - Found 5 bindable processes in GeoServer specific processes
    04 Jul 15:08:11 INFO [geoserver.wps] - Found 48 bindable processes in Geometry processes
    04 Jul 15:08:11 INFO [geoserver.wps] - Found 30 bindable processes in Vector processes
    04 Jul 15:08:11 INFO [geoserver.wps] - Blacklisting process ras:ConvolveCoverage as the input kernel of type class javax.media.jai.KernelJAI cannot be handled
    04 Jul 15:08:11 INFO [geoserver.wps] - Blacklisting process ras:RasterZonalStatistics2 as the input zones of type class java.lang.Object cannot be handled
    04 Jul 15:08:11 INFO [geoserver.wps] - Blacklisting process ras:RasterZonalStatistics2 as the input nodata of type class it.geosolutions.jaiext.range.Range cannot be handled
    04 Jul 15:08:11 INFO [geoserver.wps] - Blacklisting process ras:RasterZonalStatistics2 as the input rangeData of type class java.lang.Object cannot be handled
    04 Jul 15:08:11 INFO [geoserver.wps] - Blacklisting process ras:RasterZonalStatistics2 as the output zonal statistics of type interface java.util.List cannot be handled
    04 Jul 15:08:11 INFO [geoserver.wps] - Found 17 bindable processes in Raster processes
    04 Jul 15:08:11 INFO [ows.OWSHandlerMapping] - Mapped URL path [/wcs] onto handler 'dispatcher'
    04 Jul 15:08:11 INFO [ows.OWSHandlerMapping] - Mapped URL path [/wcs/*] onto handler 'dispatcher'
    04 Jul 15:08:11 INFO [org.geoserver] - GeoServer configuration lock is enabled
    04 Jul 15:08:11 WARN [turbojpeg.TurboJPEGMapResponse] - The turbo jpeg encoder is available for usage
    04 Jul 15:08:12 INFO [ows.OWSHandlerMapping] - Mapped URL path [/kml] onto handler 'dispatcher'
    04 Jul 15:08:12 INFO [ows.OWSHandlerMapping] - Mapped URL path [/kml/*] onto handler 'dispatcher'
    04 Jul 15:08:12 INFO [ows.OWSHandlerMapping] - Mapped URL path [/kml/icon/**/*] onto handler 'kmlIconService'
    04 Jul 15:08:13 INFO [ows.OWSHandlerMapping] - Mapped URL path [/gwc/service/**] onto handler 'dispatcher'
    04 Jul 15:08:13 INFO [geowebcache.GeoWebCacheDispatcher] - Invoked setServletPrefix(gwc)
    04 Jul 15:08:13 INFO [georss.GeoRSSPoller] - Initializing GeoRSS poller in a background job...
    04 Jul 15:08:13 INFO [georss.GeoRSSPoller] - No enabled GeoRSS feeds found, poller will not run.
    04 Jul 15:08:13 INFO [rest.RESTDispatcher] - Created RESTDispatcher with 15 paths
    04 Jul 15:08:13 INFO [wms.WMSService] - Will NOT recombine tiles for non-tiling clients.
    04 Jul 15:08:13 INFO [wms.WMSService] - Will proxy requests to backend that are not getmap or getcapabilities.
    04 Jul 15:08:13 INFO [ows.OWSHandlerMapping] - Mapped URL path [/wms] onto handler 'dispatcher'
    04 Jul 15:08:13 INFO [ows.OWSHandlerMapping] - Mapped URL path [/wms/*] onto handler 'dispatcher'
    04 Jul 15:08:14 INFO [ows.OWSHandlerMapping] - Mapped URL path [/animate/*] onto handler 'dispatcher'
    04 Jul 15:08:14 INFO [ows.OWSHandlerMapping] - Mapped URL path [/animate] onto handler 'dispatcher'
    04 Jul 15:08:14 INFO [ows.OWSHandlerMapping] - Mapped URL path [/TestWfsPost] onto handler 'wfsTestServlet'
    04 Jul 15:08:14 INFO [ows.OWSHandlerMapping] - Mapped URL path [/wfs/*] onto handler 'dispatcher'
    04 Jul 15:08:14 INFO [ows.OWSHandlerMapping] - Mapped URL path [/wfs] onto handler 'dispatcher'
    04 Jul 15:08:17 INFO [geoserver.monitor] - Monitor extension enabled
    04 Jul 15:08:18 INFO [ows.OWSHandlerMapping] - Mapped URL path [/ows/**] onto handler 'dispatcher'
    04 Jul 15:08:18 INFO [ows.OWSHandlerMapping] - Mapped URL path [/ows] onto handler 'dispatcher'
    04 Jul 15:08:18 INFO [geoserver.security] - Start reloading user/groups for service named default
    04 Jul 15:08:18 INFO [geoserver.security] - Reloading user/groups successful for service named default
    04 Jul 15:08:18 INFO [geoserver.security] - AuthenticationCache Initialized with 1000 Max Entries, 300 seconds idle time, 600 seconds time to live and 3 concurrency level
    04 Jul 15:08:18 INFO [geoserver.security] - AuthenticationCache Eviction Task created to run every 600 seconds
    04-Jul-2017 15:08:18.990 SEVERE [localhost-startStop-1] org.apache.catalina.session.StandardManager.startInternal Exception loading sessions from persistent storage
     java.lang.ClassCastException: java.io.ObjectStreamClass cannot be cast to java.lang.String
            at java.io.ObjectInputStream.readTypeString(ObjectInputStream.java:1612)
            at java.io.ObjectStreamClass.readNonProxy(ObjectStreamClass.java:719)
            at java.io.ObjectInputStream.readClassDescriptor(ObjectInputStream.java:882)
            at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1815)
            at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1713)
            at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2000)
            at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1535)
            at java.io.ObjectInputStream.readObject(ObjectInputStream.java:422)
            at org.apache.catalina.session.StandardSession.doReadObject(StandardSession.java:1611)
            at org.apache.catalina.session.StandardSession.readObjectData(StandardSession.java:1077)
            at org.apache.catalina.session.StandardManager.doLoad(StandardManager.java:218)
            at org.apache.catalina.session.StandardManager.load(StandardManager.java:162)
            at org.apache.catalina.session.StandardManager.startInternal(StandardManager.java:356)
            at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
            at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5224)
            at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
            at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:752)
            at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:728)
            at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734)
            at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:952)
            at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1823)
            at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
            at java.util.concurrent.FutureTask.run(FutureTask.java:266)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
            at java.lang.Thread.run(Thread.java:748)

    04-Jul-2017 15:08:19.031 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive /opt/tomcat/webapps/geoserver.war has finished in 27,515 ms
    04-Jul-2017 15:08:19.032 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /opt/tomcat/webapps/host-manager
    04-Jul-2017 15:08:19.060 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /opt/tomcat/webapps/host-manager has finished in 28 ms
    04-Jul-2017 15:08:19.061 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /opt/tomcat/webapps/manager
    04-Jul-2017 15:08:19.079 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /opt/tomcat/webapps/manager has finished in 18 ms
    04-Jul-2017 15:08:19.079 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /opt/tomcat/webapps/examples
    04-Jul-2017 15:08:19.217 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /opt/tomcat/webapps/examples has finished in 137 ms
    04-Jul-2017 15:08:19.217 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /opt/tomcat/webapps/docs
    04-Jul-2017 15:08:19.227 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /opt/tomcat/webapps/docs has finished in 10 ms
    04-Jul-2017 15:08:19.228 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /opt/tomcat/webapps/ROOT
    04-Jul-2017 15:08:19.238 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /opt/tomcat/webapps/ROOT has finished in 10 ms
    04-Jul-2017 15:08:19.245 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
    04-Jul-2017 15:08:19.254 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-8009"]
    04-Jul-2017 15:08:19.274 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 27815 ms
    04 Jul 15:08:19 WARN [util.JDBCExceptionReporter] - SQL Error: 0, SQLState: 23502
    04 Jul 15:08:19 ERROR [util.JDBCExceptionReporter] - ERROR: null value in column "id" violates not-null constraint
      Detail: Failing row contains (null, FINISHED, OTHER, /, null, null, null, 0, 192.168.1.235, ROS-GS3, GET, 2017-07-04 15:08:19.893, 2017-07-04 15:08:19.911, 18, 192.168.1.185, null, null, Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KH..., null, null, 0, 0, null, null, null, null, null, 0, null, null, 200, null, 1, 1, -1, -1, null).
    04 Jul 15:08:19 WARN [util.JDBCExceptionReporter] - SQL Error: 0, SQLState: 23502
    04 Jul 15:08:19 ERROR [util.JDBCExceptionReporter] - ERROR: null value in column "id" violates not-null constraint
      Detail: Failing row contains (null, FINISHED, OTHER, /, null, null, null, 0, 192.168.1.235, ROS-GS3, GET, 2017-07-04 15:08:19.893, 2017-07-04 15:08:19.911, 18, 192.168.1.185, null, null, Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KH..., null, null, 0, 0, null, null, null, null, null, 0, null, null, 200, null, 1, 1, -1, -1, null).
    04 Jul 15:26:15 WARN [geoserver.security] - Failed login, user admin from 192.168.1.185
    04 Jul 15:26:15 INFO [geoserver.security] - Brute force attack prevention, delaying login for 1672ms
    04 Jul 15:26:16 INFO [geoserver.security] - Strong cryptography is available

我更深入地调查了一下,发现了这个

2017-07-04 14:52:19,339 WARN [servlet.PageNotFound] - No mapping found for HTTP request with URI [/geoserver/j_spring_oauth2_google_login] in DispatcherServlet with name 'dispatcher'

推荐答案

您是否可以提供有关身份验证阶段的Geoserver日志?

它应该报告您可能遇到的任何潜在异常。如果没有,请尝试提升Geoserver日志级别以进行调试。

通常,该行为意味着对OAuth2提供程序的请求以某种方式失败,在您的特定情况下(如果我正确理解了您要尝试做什么),很可能取决于证书的PKIX问题。可能是由于某种原因,您没有正确配置Tomcat实例上的信任库。

还请记住,如果要启用SSL协议,还需要为Geoserver实例使用HTTPS端点。否则,我建议您选择普通的。

这篇关于使用OAuth2 Google Extension for Geoserver,Geoserver主页不会重定向到Google登录页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆