Skip to content

Add OneID provider (Uzbekistan SSO)#1394

Open
aslnbxrz wants to merge 1 commit intoSocialiteProviders:masterfrom
aslnbxrz:feature/oneid
Open

Add OneID provider (Uzbekistan SSO)#1394
aslnbxrz wants to merge 1 commit intoSocialiteProviders:masterfrom
aslnbxrz:feature/oneid

Conversation

@aslnbxrz
Copy link

This PR adds support for Uzbekistan’s OneID SSO provider. Endpoints: https://sso.egov.uz/sso/oauth/Authorization.do. Supports grant_type one_authorization_code and one_access_token_identify.

@aslnbxrz
Copy link
Author

Why this pull request is not being accepted? Is anything wrong with it?

],
'headers' => ['Accept' => 'application/json'],
]);
Log::info('OneIDSocialiteLogout', [
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are there logs here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^

'accessTokenOrSessionId' => $accessTokenOrSessionId,
]);
} catch (Throwable $e) {
Log::error('OneIDSocialiteThrow', [
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here, we cannot be catching excpetions like this

*/
protected function getConfig(?string $key = null, mixed $default = null): mixed
{
$config = Config::get('services.oneid');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason this can't be a function in the provider?

// Odd => male, Even => female
return ((int)$pin[0]) % 2 ? 'male' : 'female';
}
} No newline at end of file
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

newline

'access_token' => $token,
'scope' => $this->getScope(),
],
'headers' => ['Accept' => 'application/json'],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the default already


protected function mapUserToObject(array $user): OneIDUser
{
// Build fallback name if full_name is missing
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is middle name after lastname? also remove the comments as they are not needed

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its typically like this in Uzbekistan fist_name + last_name + mid_name like "Bexruz Aslonov Botir o'g'li";
comments will be removed.

Copy link
Member

@atymic atymic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other issues still not resolved

],
'headers' => ['Accept' => 'application/json'],
]);
Log::info('OneIDSocialiteLogout', [
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants