glpi-singlesignon icon indicating copy to clipboard operation
glpi-singlesignon copied to clipboard

Provider not defined

Open wmeneses opened this issue 2 years ago • 34 comments

I have tried with Azure or generic, but in both options I get this option

wmeneses avatar Apr 11 '22 19:04 wmeneses

configured with google ,got error "Provider not defined."

champakakumara avatar May 17 '22 11:05 champakakumara

SOLVED for google in file provider.class.php change in line 907: 'redirect_uri' => $this->getCurrentURL(), to 'redirect_uri' => 'https://YOUR-SITE-NAME/plugins/singlesignon/front/callback.php/provider/',

and

in file callback.php in line 12

$provider_id = 1; //PluginSinglesignonToolbox::getCallbackParameters('provider'); insert ID

astep3000 avatar May 18 '22 18:05 astep3000

SOLVED for google in file provider.class.php change in line 907: 'redirect_uri' => $this->getCurrentURL(), to 'redirect_uri' => 'https://YOUR-SITE-NAME/plugins/singlesignon/front/callback.php/provider/',

and

in file callback.php in line 12

$provider_id = 1; //PluginSinglesignonToolbox::getCallbackParameters('provider'); insert ID

HI

I change above lines but got error " Error 400: redirect_uri_mismatch" any Idea?

champakakumara avatar May 19 '22 05:05 champakakumara

fill in DB table "glpi_plugin_singlesignon_providers" manually: image

  "url_authorize": "https://accounts.google.com/o/oauth2/v2/auth",
  "url_access_token": "https://www.googleapis.com/oauth2/v4/token",
  "url_resource_owner_details": "https://openidconnect.googleapis.com/v1/userinfo",
  "scope": "openid email profile"

astep3000 avatar May 19 '22 05:05 astep3000

image

astep3000 avatar May 19 '22 05:05 astep3000

image

thanks, now work and redirect from google but login failed

image

champakakumara avatar May 19 '22 07:05 champakakumara

  1. Add emails (one or many) to user account.
  2. Add params AuthorizedDomains to config in plugin image

astep3000 avatar May 19 '22 08:05 astep3000

may be space? del space image

or try leaving one domain for test

astep3000 avatar May 19 '22 09:05 astep3000

image

image

email address configured to glpi user and configured popupAuth and authorized Domain but same error

what I misconfigure?

champakakumara avatar May 19 '22 09:05 champakakumara

test with one domain but same result

champakakumara avatar May 19 '22 09:05 champakakumara

may be space? del space image

or try leaving one domain for test

test with one domain but same error

champakakumara avatar May 19 '22 09:05 champakakumara

😄 It's the same case with AZURE, although I only modified the callback file and it worked fine, thanks for enlightening my way. I have tested it on 9.5 and 10

wmeneses avatar May 19 '22 19:05 wmeneses

Hi everyone, I have been working on anothers projects at moment, and because of that I couldn't see these kind of problems.

Pull request are welcome

edgardmessias avatar May 20 '22 15:05 edgardmessias

Could you update to latest release and run "Test" from config page?

https://github.com/edgardmessias/glpi-singlesignon/releases/tag/v1.3.3

edgardmessias avatar Jun 29 '22 02:06 edgardmessias

I installed new version but got error again " Authorization Error ,Error 400: redirect_uri_mismatch"

DB table "glpi_plugin_singlesignon_providers " correct and Authorized redirect URIs was correct on google console

champakakumara avatar Jun 29 '22 06:06 champakakumara

Check the callback URL in the provider, because that was missing the provider number

edgardmessias avatar Jun 29 '22 11:06 edgardmessias

in file callback.php in line 12

$provider_id = PluginSinglesignonToolbox::getCallbackParameters('provider');

I change it like below

$provider_id =1;

but same error, any misconfigure?

Authorized redirect URIs on google console (https://console.cloud.google.com/) like below https://xxx.xxxx.lk/plugins/singlesignon/front/callback.php/provider/1

champakakumara avatar Jun 29 '22 11:06 champakakumara

Now Work ,I changed provider.class.php callback URL. now work thanks

champakakumara avatar Jun 29 '22 11:06 champakakumara

New version work with google SSO

champakakumara avatar Jun 29 '22 12:06 champakakumara

Another issue only one user can connect (only my email-admin) other user same domain or different domain can't connect. Error "user not authorized to connect toGLPI"

champakakumara avatar Jun 30 '22 09:06 champakakumara

Hi all, I follow this issue and the workarounds but I still have the problem : URI Mismatch. : AADSTS50011: The redirect URI 'https://xxxxxxxxxx/plugins/singlesignon/front/callback.php/provider/Array' As You can see, the provider ID is Array and not 2 like in configuration plugin page.

I modified the files : front/callback.php and inc/provider.class.php but nothing change. I am with version 1.3.3 Thanks

sachaw0lf avatar Jul 01 '22 08:07 sachaw0lf

Hi, I fixed the url callback in the master branch.

edgardmessias avatar Jul 01 '22 10:07 edgardmessias

I just tested with the fix, it works perfectly. Thanks a lot !

sachaw0lf avatar Jul 01 '22 12:07 sachaw0lf

Hello, I have same issue when try to log with Google Account 'Provider not definied' When i do the test 'Test single sign-on' it works fine.

The call address when try to log with Google is 'plugins/singlesignon/front/callback.php/provider/Array' I setup the callback URI with plugins/singlesignon/front/callback.php/provider/1 on Goole API

Any idea ?

AdminCeci avatar Jul 26 '22 17:07 AdminCeci

Hello, I have same issue when try to log with Google Account 'Provider not definied' When i do the test 'Test single sign-on' it works fine.

The call address when try to log with Google is 'plugins/singlesignon/front/callback.php/provider/Array' I setup the callback URI with plugins/singlesignon/front/callback.php/provider/1 on Goole API

Any idea ?

https://github.com/edgardmessias/glpi-singlesignon/commit/c7b1be17b3c2d80c6df31d334d3c7d3de1214a74

Megachip avatar Sep 09 '22 16:09 Megachip

Hello,

Did someone make it work properly using Keycloak (using Azure as Login method)?

I've done all the troubleshooting of this Issue but I can't pass through "User is not authorized to connect in GLPI"

This GLPI had LDAP Authentication, so it has a lot of legacy users, it may be a problem?

Follow my current configuration:

image image image

RaulGrosmam avatar May 26 '23 13:05 RaulGrosmam

H 223Capture ello, I updated the plugin in the system to the latest version, corrected the php files as indicated in this thread, but it still gives an error as in the screenshot. What could be the problem?

glpi+keycloak

Phantom505 avatar Aug 01 '23 07:08 Phantom505

H 223Capture ello, I updated the plugin in the system to the latest version, corrected the php files as indicated in this thread, but it still gives an error as in the screenshot. What could be the problem?

glpi+keycloak

Check if the user was created an if it has any kind of permission to access GLPI

RaulGrosmam avatar Aug 01 '23 11:08 RaulGrosmam

H 223Capture ello, I updated the plugin in the system to the latest version, corrected the php files as indicated in this thread, but it still gives an error as in the screenshot. What could be the problem? glpi+keycloak

Check if the user was created an if it has any kind of permission to access GLPI

a user has been created on the keycloak side, there are accesses between servers, a button appears in glpi through which I pass authorization on keycloak, then it redirects me to glpi where I get this error

Phantom505 avatar Aug 01 '23 11:08 Phantom505

i just try to setup the plugin with Azure and i had the error Provider not defined. I juste change in callback.php in line 12

$provider_id = PluginSinglesignonToolbox::getCallbackParameters('provider');

I change it like below

$provider_id =1;

I had to adapt the uri and then it work: before: www.myglpi.com/plugins/singlesignon/front/callback.php/provider/1 after: www.myglpi.com/plugins/singlesignon/front/callback.php/provider/Array

SkoEdi avatar Aug 02 '23 09:08 SkoEdi