Closed haneef95 closed 2 years ago
an azure adpater can be added as separate plugin now
An adapter for AzureAD doesn't exist yet, hence, just using the Keycloak adapter like so:
Key | Value -- | -- plugin»oauthkeycloak»keyClient ID | `Hopefully, an AzureAD adapter is released soon with the Microsoft logo, or even a generic OIDC one with the option to have custom logo and label.
Please note that there is an Azure plugin for oauth now: https://www.dokuwiki.org/plugin:oauthazure
Hi,
After some tinkering I've done some minor changes to the code to implement Azure AD Open ID Connect.
Logic: the Keycloak implementation uses OIDC, so, that would be the easiest one to tinker with.
After installing this plugin (version date 2020-06-14)
Required steps
**Note:** You could use different endpoint urls for auth and token as per your needs.
(located in: \lib\plugins\oauth\classes\KeycloakAdapter.php)
file: On line 32, replace:$data['user'] = $result['preferred_username'];
(As the Microsoft UserInfo endpoint doesn't supply a 'preferred_username' field. with:$data['user'] = $result['name'];
You can now login through Microsoft by clicking on the Login wtih 'Keycloak' button.
Optional steps (To change the logo and name in the login page)
Upload the Microsoft logo to![microsoft](https://user-images.githubusercontent.com/298208/137568177-36b81917-73b8-4b73-b459-93186343ef41.png)
\lib\plugins\oauth\images\microsoft.png
.Edit the style.less
(located in: \lib\plugins\oauth\style.less)
file: After line 55, add:The code should look like this:![image](https://user-images.githubusercontent.com/298208/137568267-ea88ea51-36e5-4172-b4ec-91c0b582cba2.png)
Result should look like this:
(Not ideal to have it saying 'Keycloak' in the end, but, that's the result.
Hope this helps.
Thanks,