Skip to content

Commit 7bc6a0a

Browse files
committed
Add Microsoft Azure SSO provider
1 parent f9dc7ad commit 7bc6a0a

File tree

7 files changed

+80
-4
lines changed

7 files changed

+80
-4
lines changed

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,7 @@ environment:
118118
119119
### Enable OAuth providers
120120
121-
Many Notes supports a convenient way to authenticate with OAuth providers. Typically, these credentials may be retrieved by creating a "developer application" within the dashboard of the service you wish to use. Many Notes currently supports authentication via Authelia, Authentik, Bitbucket, Facebook, GitHub, GitLab, Google, Keycloak, LinkedIn, Pocket ID, Slack, Twitter, and Zitadel. You can enable multiple providers simultaneously by adding the corresponding environment variables.
122-
121+
Many Notes supports a convenient way to authenticate with OAuth providers. Typically, these credentials may be retrieved by creating a "developer application" within the dashboard of the service you wish to use. Many Notes currently supports authentication via Authelia, Authentik, Azure, Bitbucket, Facebook, GitHub, GitLab, Google, Keycloak, LinkedIn, Pocket ID, Slack, Twitter, and Zitadel. You can enable multiple providers simultaneously by adding the corresponding environment variables.
123122
124123
For example, to enable GitHub OAuth, add:
125124
@@ -130,7 +129,7 @@ environment:
130129
- GITHUB_REDIRECT_URI=http://localhost/oauth/github/callback # change domain and provider
131130
```
132131
133-
Authelia, Authentik, Keycloak, and Zitadel providers require additional configuration. Read the [OAuth documentation](./docs/customization/oauth.md) for more information.
132+
Some providers require additional environment variables. Read the [OAuth documentation](./docs/customization/oauth.md) for more information.
134133
135134
### Local authentication (default: true)
136135

app/Enums/OAuthProvider.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ enum OAuthProvider: string
88
{
99
case Authelia = 'authelia';
1010
case Authentik = 'authentik';
11+
case Azure = 'azure';
1112
case Bitbucket = 'bitbucket';
1213
case Facebook = 'facebook';
1314
case GitHub = 'github';

app/Providers/AppServiceProvider.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
use Override;
1818
use SocialiteProviders\Authelia\Provider as AutheliaProvider;
1919
use SocialiteProviders\Authentik\Provider as AuthentikProvider;
20+
use SocialiteProviders\Azure\Provider as AzureProvider;
2021
use SocialiteProviders\Keycloak\Provider as KeycloakProvider;
2122
use SocialiteProviders\Manager\SocialiteWasCalled;
2223
use SocialiteProviders\PocketID\Provider as PocketIDProvider;
@@ -111,6 +112,9 @@ private function configureSocialite(): void
111112
Event::listen(function (SocialiteWasCalled $event): void {
112113
$event->extendSocialite('authentik', AuthentikProvider::class);
113114
});
115+
Event::listen(function (SocialiteWasCalled $event): void {
116+
$event->extendSocialite('azure', AzureProvider::class);
117+
});
114118
Event::listen(function (SocialiteWasCalled $event): void {
115119
$event->extendSocialite('keycloak', KeycloakProvider::class);
116120
});

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"socialiteproviders/authelia": "^4.0",
1717
"socialiteproviders/authentik": "^5.2",
1818
"socialiteproviders/keycloak": "^5.3",
19+
"socialiteproviders/microsoft-azure": "^5.2",
1920
"socialiteproviders/pocketid": "^5.0",
2021
"socialiteproviders/zitadel": "^4.2",
2122
"staudenmeir/eloquent-has-many-deep": "^1.21.1",

composer.lock

Lines changed: 52 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/services.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,14 @@
4646
'post_logout_redirect_uri' => env('AUTHENTIK_POST_LOGOUT_REDIRECT_URI'),
4747
],
4848

49+
'azure' => [
50+
'client_id' => env('AZURE_CLIENT_ID'),
51+
'client_secret' => env('AZURE_CLIENT_SECRET'),
52+
'redirect' => env('AZURE_REDIRECT_URI'),
53+
'tenant' => env('AZURE_TENANT_ID'),
54+
'proxy' => env('AZURE_PROXY'),
55+
],
56+
4957
'bitbucket' => [
5058
'client_id' => env('BITBUCKET_CLIENT_ID'),
5159
'client_secret' => env('BITBUCKET_CLIENT_SECRET'),

docs/customization/oauth.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,18 @@ environment:
2222
- AUTHENTIK_BASE_URL=http://your-authentik-url # change url
2323
```
2424
25+
## Azure
26+
27+
To enable Azure OAuth, add:
28+
29+
```yaml
30+
environment:
31+
- AZURE_CLIENT_ID=CLIENT_ID # change id
32+
- AZURE_CLIENT_SECRET=CLIENT_SECRET # change secret
33+
- AZURE_TENANT_ID=TENANT_ID # change id
34+
- AZURE_PROXY=http://your-proxy-url # change url (optional configuration)
35+
```
36+
2537
## Keycloak
2638
2739
To enable Keycloak OAuth, add:

0 commit comments

Comments
 (0)