TheNetworg / oauth2-azure

Azure AD provider for the OAuth 2.0 Client.
https://packagist.org/packages/thenetworg/oauth2-azure
MIT License
230 stars 108 forks source link

Undefined class constant 'ENDPOINT_VERSION_1_0' #120

Open alessander-maia opened 4 years ago

alessander-maia commented 4 years ago

I'm getting this error, can you help me please?

PHP Fatal error: Uncaught Error: Undefined class constant 'ENDPOINT_VERSION_1_0'

alessander-maia commented 4 years ago

And this error that comes after also:

PHP Fatal error: Uncaught Error: Call to undefined method TheNetworg\OAuth2\Client\Provider\Azure::getRootMicrosoftGraphUri()

hajekj commented 4 years ago

Hey there. Please switch to the tag version of the library which you are using v1.4.X likely in branches. And check the readme there. The master readme is development version.. I am aware of this issue and plan to fix it soon.


From: alessander-maia notifications@github.com Sent: Friday, August 28, 2020 4:27:47 PM To: TheNetworg/oauth2-azure oauth2-azure@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Subject: Re: [TheNetworg/oauth2-azure] Undefined class constant 'ENDPOINT_VERSION_1_0' (#120)

And this error that comes after also:

PHP Fatal error: Uncaught Error: Call to undefined method TheNetworg\OAuth2\Client\Provider\Azure::getRootMicrosoftGraphUri()

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FTheNetworg%2Foauth2-azure%2Fissues%2F120%23issuecomment-682616079&data=02%7C01%7Cjan.hajek%40thenetw.org%7C6f87541150e14476ff3708d84b5e8a23%7C67266d438de7494d9ed83d1bd3b3a764%7C1%7C0%7C637342216704134027&sdata=1i9icHK7LWv1zyBia8XPYUyQVWFabfrlh17zDNEzv5k%3D&reserved=0, or unsubscribehttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAB7TT6LVLDTX77L2I6M5RGTSC65GHANCNFSM4QOF6CCQ&data=02%7C01%7Cjan.hajek%40thenetw.org%7C6f87541150e14476ff3708d84b5e8a23%7C67266d438de7494d9ed83d1bd3b3a764%7C1%7C0%7C637342216704134027&sdata=mLUMQEJzu7h%2BgNhCEp%2B0TQnMdvLcFB1qKw3nLu3LsK8%3D&reserved=0.

alessander-maia commented 4 years ago

Thank you! I'm being directed to microsoft login (https://login.microsoftonline.com/common/oauth2/) I need to load my policy with something like this (https://aniversariooutbackdev.b2clogin.com/aniversariooutbackdev.onmicrosoft.com/policy_name ). Do I need to change any settings?

alessander-maia commented 4 years ago

Sorry man, I found the b2c code in the readme file but it still carries the wrong endpoint. now i'm getting the error:

https://prnt.sc/u7knlc

download

hajekj commented 4 years ago

I think you have the endpoint wrong… I think for B2C the address is yourinstance.b2clogin.com

From: alessander-maia notifications@github.com Sent: Friday, August 28, 2020 17:29 To: TheNetworg/oauth2-azure oauth2-azure@noreply.github.com Cc: Jan Hajek jan.hajek@thenetw.org; Comment comment@noreply.github.com Subject: Re: [TheNetworg/oauth2-azure] Undefined class constant 'ENDPOINT_VERSION_1_0' (#120)

Sorry man, I found the b2c code in the readme file but it still carries the wrong endpoint. now i'm getting the error:

https://prnt.sc/u7knlchttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fprnt.sc%2Fu7knlc&data=02%7C01%7Cjan.hajek%40thenetw.org%7C599aa794225845efd4cf08d84b672234%7C67266d438de7494d9ed83d1bd3b3a764%7C1%7C0%7C637342253627505175&sdata=%2F7nq%2F6M7X2GZ58GNvGKMsVZdIey5%2F0pShHUBpj316sQ%3D&reserved=0

[download]https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fuser-images.githubusercontent.com%2F23323034%2F91585125-05988000-e92a-11ea-86fa-43d0ed51918c.png&data=02%7C01%7Cjan.hajek%40thenetw.org%7C599aa794225845efd4cf08d84b672234%7C67266d438de7494d9ed83d1bd3b3a764%7C1%7C0%7C637342253627515169&sdata=tx62DXmHgU94rJuorwjzFOGHJpbGjs7JXwJHtqBVLdo%3D&reserved=0

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FTheNetworg%2Foauth2-azure%2Fissues%2F120%23issuecomment-682713478&data=02%7C01%7Cjan.hajek%40thenetw.org%7C599aa794225845efd4cf08d84b672234%7C67266d438de7494d9ed83d1bd3b3a764%7C1%7C0%7C637342253627515169&sdata=uBZQfgQciZJG60JHM9xjYiNJmhpzap1qjoeHZzTDK88%3D&reserved=0, or unsubscribehttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAB7TT6KS7NX6DXMW75P4R43SC7EM7ANCNFSM4QOF6CCQ&data=02%7C01%7Cjan.hajek%40thenetw.org%7C599aa794225845efd4cf08d84b672234%7C67266d438de7494d9ed83d1bd3b3a764%7C1%7C0%7C637342253627525168&sdata=IVnqQAo%2BDzgW8TULRFjPIP7sk2MRUFOLtTOQC8Petno%3D&reserved=0.

alessander-maia commented 4 years ago

Screenshot_2

I changed the "urlLogin" and managed to load my policy but when I try to get the acess_token I get the following error: PHP Fatal error: Uncaught UnexpectedValueException: Invalid response received from Authorization Server. Expected JSON.

This is happening because I am getting this graph return: Screenshot_3

Am I using any wrong config?