<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Hi Jules,</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I had already modified the URIs, both in geonode and geoserver. I tried to delete all the tokens (Access and Grant) and it worked!</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Thanks for your help!</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Maxime<br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>De :</b> Jules Grillot <jules.grillot@gmail.com><br>
<b>Envoyé :</b> 12 mars 2020 04:12<br>
<b>À :</b> Maxime Audet-Roberge <maximeaudetr@hotmail.com><br>
<b>Cc :</b> geonode-users@lists.osgeo.org <geonode-users@lists.osgeo.org><br>
<b>Objet :</b> Re: [GeoNode-users] Problem with authentication between geonode and geoserver after a restore</font>
<div> </div>
</div>
<div>
<div dir="ltr">
<div>
<div>
<div>
<div>
<div>
<div>Hi Maxime,<br>
<br>
</div>
In my case the restore of my geonode instance sets all parameters to default (oauth, theme, monitoring,...).<br>
</div>
If it's the same for you, you have to change the "Redirect uris" of GeoServer in GeoNode's Application panel in Administration (<a href="http://yourgeonode/fr/admin/oauth2_provider/application/">http://yourgeonode/fr/admin/oauth2_provider/application/</a>).<br>
</div>
The uris as to be the same as the Redirect Url from the "geonode-auth2" authentication filter in Geoserver.<br>
<br>
</div>
<div>Here is the documentation :<br>
<a href="https://docs.geonode.org/en/2.10/advanced/components/index.html#oauth2-security-authentication-and-authorization">https://docs.geonode.org/en/2.10/advanced/components/index.html#oauth2-security-authentication-and-authorization</a></div>
<div><br>
</div>
If you want to change the by default URL so the restore don't break the connection between the Geonode and Geoserver you have to change the "redirect uris" in this file :<br>
<a href="https://github.com/GeoNode/geonode/blob/master/geonode/base/fixtures/default_oauth_apps.json">https://github.com/GeoNode/geonode/blob/master/geonode/base/fixtures/default_oauth_apps.json</a><br>
<br>
</div>
Hope it helps you,<br>
<br>
</div>
Jules<br>
</div>
<br>
<div class="x_gmail_quote">
<div dir="ltr" class="x_gmail_attr">Le mer. 11 mars 2020 à 18:41, Maxime Audet-Roberge <<a href="mailto:maximeaudetr@hotmail.com">maximeaudetr@hotmail.com</a>> a écrit :<br>
</div>
<blockquote class="x_gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left:1px solid rgb(204,204,204); padding-left:1ex">
<div>
<div dir="auto" style="color:rgb(33,33,33); background-color:rgb(255,255,255); text-align:left">
<span style="font-family:Calibri,sans-serif; font-size:11pt">Good day geonode users,</span><br>
</div>
<div id="x_gmail-m_-2448335767392795335id-ae3f0e4f-e95a-4174-a232-131e6429499a" dir="auto" style="text-align:left">
<div dir="auto" style="text-align:left">
<p class="x_MsoNormal"> </p>
<p class="x_MsoNormal">I am trying to restore my geonode instance on a different machine but I have a problem with the authentication between geonode and geoserver. I am using geonode project 2.10.1 and geoserver 2.15.2 on a Ubuntu 18.04 machine.</p>
<p class="x_MsoNormal"> </p>
<p class="x_MsoNormal">First, I install geonode and geoserver. At that point, everything is working fine; I can connect to geoserver from my geonode admin account. Then I restore the geoserver data by replacing the geoserver_data directory. Everything is still
working fine at that point. The problem occurs when I restore the geonode data; I can no longer login to geoserver from my geonode account. I have this message in the geoserver log:</p>
<p class="x_MsoNormal">2020-03-11 17:23:24,700 WARN [geoserver.security] - Error while trying to authenticate to OAuth2 Provider with the following Exception cause:</p>
<p class="x_MsoNormal">error="access_denied", error_description="Error requesting access token."</p>
<p class="x_MsoNormal"> </p>
<p class="x_MsoNormal">Strangely, I still have access to my data on geonode, I can consult them and display them on a map.
</p>
<p class="x_MsoNormal"> </p>
<p class="x_MsoNormal">Anybody got any ideas?</p>
<p class="x_MsoNormal"> </p>
<p class="x_MsoNormal">Cheers!</p>
<p class="x_MsoNormal"> </p>
<p class="x_MsoNormal">Maxime</p>
<p class="x_MsoNormal"> </p>
</div>
</div>
</div>
_______________________________________________<br>
geonode-users mailing list<br>
<a href="mailto:geonode-users@lists.osgeo.org" target="_blank">geonode-users@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/geonode-users" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/geonode-users</a><br>
</blockquote>
</div>
</div>
</body>
</html>