Open etj opened 6 days ago
The auth request needs a POST call: https://github.com/GeoNode/geonode/blob/4.4.1/geonode/security/views.py#L356-L357
Anyway the ReadOnlyMiddleware
allows for a WHITELISTED_URL_NAMES
, so fix should be straightforward:
https://github.com/GeoNode/geonode/blob/4.4.1/geonode/base/middleware.py#L27-L41
Maintenance mode could also block auth request, but probably it's ok:
https://github.com/GeoNode/geonode/blob/4.4.1/geonode/base/middleware.py#L65-L79
GeoNode returns a
405 Method Not Allowed
when an oauth request is done while in ReadOnly mode. The response contains strings like:Your instance is currently in Read-Only mode.</b><br><br>Performing any changes is disallowed on this instace.
GeoServer log
``` 19 Nov 15:52:53 WARN [geoserver.security] - Error while trying to authenticate to OAuth2 Provider with the following Exception cause: error="access_denied", error_description="Error requesting access token." at org.springframework.security.oauth2.client.token.OAuth2AccessTokenSupport.retrieveToken(OAuth2AccessTokenSupport.java:149) at org.springframework.security.oauth2.client.token.grant.code.AuthorizationCodeAccessTokenProvider.obtainAccessToken(AuthorizationCodeAccessTokenProvider.java:213) at org.springframework.security.oauth2.client.token.AccessTokenProviderChain.obtainNewAccessTokenInternal(AccessTokenProviderChain.java:155) at org.springframework.security.oauth2.client.token.AccessTokenProviderChain.obtainAccessToken(AccessTokenProviderChain.java:128) at org.springframework.security.oauth2.client.OAuth2RestTemplate.acquireAccessToken(OAuth2RestTemplate.java:241) at org.springframework.security.oauth2.client.OAuth2RestTemplate.getAccessToken(OAuth2RestTemplate.java:183) at org.springframework.security.oauth2.client.OAuth2RestTemplate$$FastClassBySpringCGLIB$$ca6dc720.invoke(Your instance is currently in Read-Only mode.
Performing any changes is disallowed on this instace.
Issue found on 4.3.1, replicated on development (5.0.0.dev0)