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

Error in v.2.0.0 branch : OpenSSL unable to verify data #26

Closed easyhrworld closed 7 years ago

easyhrworld commented 7 years ago

Hi,

Today suddenly I am getting below error after updating files from composer. When I try to login through oauth2, it gives me below error.

OpenSSL unable to verify data: error:0906D06C:PEM routines:PEM_read_bio:no start line
#0 /var/app/current/application/vendor/firebase/php-jwt/src/JWT.php(96): Firebase\JWT\JWT::verify('eyJ0eXAiOiJKV1Q...', 'Q\xFE\xBB\ns&\xA7\xA1Cy\xC2\xB6\xF7\xEFk...', '-----BEGIN PUBL...', 'RS256') 
#1 /var/app/current/application/vendor/thenetworg/oauth2-azure/src/Provider/Azure.php(297): Firebase\JWT\JWT::decode('eyJ0eXAiOiJKV1Q...', Array, Array) 
#2 /var/app/current/application/vendor/thenetworg/oauth2-azure/src/Token/AccessToken.php(64): TheNetworg\OAuth2\Client\Provider\Azure->validateToken('eyJ0eXAiOiJKV1Q...') 
#3 /var/app/current/application/vendor/thenetworg/oauth2-azure/src/Provider/Azure.php(122): TheNetworg\OAuth2\Client\Token\AccessToken->__construct(Array, Object(TheNetworg\OAuth2\Client\Provider\Azure)) 
#4 /var/app/current/application/vendor/league/oauth2-client/src/Provider/AbstractProvider.php(561): TheNetworg\OAuth2\Client\Provider\Azure->createAccessToken(Array, Object(League\OAuth2\Client\Grant\AuthorizationCode)) 
#5 /var/app/current/application/vendor/thenetworg/oauth2-azure/src/Provider/Azure.php(70): League\OAuth2\Client\Provider\AbstractProvider->getAccessToken('authorization_c...', Array) #6 /var/app/current/application/controllers/Openauth.php(156): TheNetworg\OAuth2\Client\Provider\Azure->getAccessToken('authorization_c...', Array) 
#7 [internal function]: Openauth->validate_office() 
#8 /var/app/current/system/core/CodeIgniter.php(514): call_user_func_array(Array, Array) 
#9 /var/app/current/index.php(291): require_once('/var/app/curren...') 
#10 {main}

Till yesterday it was running fine. I was able to login successfully. Can you please check what is the issue.

Kanhai

hajekj commented 7 years ago

Could you possibly provide some more information about your environment? I am unable to reproduce this on my testing environment running on Azure's App Service.

hajekj commented 7 years ago

Okay, was actually able to reproduce this issue, working on a fix now.

kanhaic commented 7 years ago

we are using this with office 365 login. let me know what information you need.

hajekj commented 7 years ago

This should be resolved now, can you please verify that it works? Were you using the v2.0 endpoint for single sign on, as in - https://login.microsoftonline.com/{tenant}/v2.0/?

kanhaic commented 7 years ago

we were using https://login.microsoftonline.com/common/oauth2/authorize?scope=openid+email+profile&state=ZGx2m1gef6JR0TJ4qA0ij7wIx0C8dhfo&response_type=code&approval_prompt=auto&client_id=86f54c20-3a40-457c-b2fc-183dbfbc43e6&redirect_uri=https%3A%2F%2Fdevdb2.localhost%2Fopenauth%2Fvalidate_office as an end point.

easyhrworld commented 7 years ago

@hajekj, Thanks it is working now.