|
1 | | -<?php |
2 | | -// |
3 | | -// filesource oauth.azuread.inc.php |
4 | | -// |
5 | | -// Azure AD |
6 | | -// Fill in CLIENT_ID, |
7 | | -// CLIENT_SECRET, |
8 | | -// YOURTESTLINKSERVER, |
9 | | -// TENANTID |
10 | | -// with your information |
11 | | -// See this article for registering an application: https://docs.microsoft.com/en-us/azure/active-directory/develop/v1-protocols-oauth-code |
12 | | -// Make sure, you grant admint consent for it: https://docs.microsoft.com/en-us/azure/active-directory/manage-apps/configure-user-consent |
13 | | - |
14 | | -// |
15 | | -// IMPORTANTE NOTICE |
16 | | -// key in $tlCfg->OAuthServers[] |
17 | | -// can be anything you want that make this configuration |
18 | | -// does not overwrite other or will be overwritten |
19 | | -// |
20 | | -// HOW TO use this file ? |
21 | | -// 1. copy this file to |
22 | | -// [TESTLINK_INSTALL]/cfg/ |
23 | | -// |
24 | | -// 2. configure according your application |
25 | | -// |
26 | | -// 3. add the following line to your custom_config.inc.php |
27 | | -// require('aouth.azuread.inc.php'); |
28 | | -// |
29 | | -// ------------------------------------------------------------- |
30 | | -$tlCfg->OAuthServers['azuread'] = array(); |
31 | | - |
32 | | -$tlCfg->OAuthServers['azuread']['redirect_uri'] = (empty($_SERVER['HTTPS']) ? 'http://' : 'https://') . $_SERVER['HTTP_HOST'] . '/login.php'; |
33 | | - |
34 | | - |
35 | | -$tlCfg->OAuthServers['azuread']['oauth_client_id'] = 'CHANGE_WITH_CLIENT_ID'; |
36 | | -$tlCfg->OAuthServers['azuread']['oauth_client_secret'] = |
37 | | - 'CHANGE_WITH_CLIENT_SECRET'; |
38 | | - |
39 | | -// https://login.microsoftonline.com/YOUR_TENANT_ID/v2.0/.well-known/openid-configuration |
40 | | -$azureADBaseURL = 'https://login.microsoftonline.com/CHANGE_WITH_TENANT_ID'; |
41 | | -$msGraphURL = 'https://graph.microsoft.com'; |
42 | | -$tlCfg->OAuthServers['azuread']['oauth_url'] = |
43 | | - $azureADBaseURL . '/oauth2/v2.0/authorize'; |
44 | | - |
45 | | -$tlCfg->OAuthServers['azuread']['token_url'] = |
46 | | - $azureADBaseURL . '/oauth2/v2.0/token'; |
47 | | - |
48 | | -$tlCfg->OAuthServers['azuread']['oauth_profile'] = |
49 | | - $msGraphURL . '/oidc/userinfo'; |
50 | | - |
51 | | - |
52 | | -$tlCfg->OAuthServers['azuread']['oauth_enabled'] = true; |
53 | | -$tlCfg->OAuthServers['azuread']['oauth_name'] = 'azuread'; //do not change this |
54 | | -$tlCfg->OAuthServers['azuread']['oauth_force_single'] = true; |
55 | | -$tlCfg->OAuthServers['azuread']['oauth_grant_type'] = 'authorization_code'; |
56 | | - |
57 | | -// the domain you want to whitelist (email domains) |
58 | | -$tlCfg->OAuthServers['azuread']['oauth_domain'] = 'autsoft.hu'; |
59 | | - |
60 | | - |
61 | | -$tlCfg->OAuthServers['azuread']['oauth_scope'] = |
62 | | - 'https://graph.microsoft.com/mail.read https://graph.microsoft.com/user.read openid profile email'; |
| 1 | +<?php |
| 2 | +// |
| 3 | +// filesource oauth.azuread.inc.php |
| 4 | +// |
| 5 | +// Azure AD |
| 6 | +// Fill in CLIENT_ID, |
| 7 | +// CLIENT_SECRET, |
| 8 | +// YOURTESTLINKSERVER, |
| 9 | +// TENANTID |
| 10 | +// with your information |
| 11 | +// See this article for registering an application: https://docs.microsoft.com/en-us/azure/active-directory/develop/v1-protocols-oauth-code |
| 12 | +// Make sure, you grant admint consent for it: https://docs.microsoft.com/en-us/azure/active-directory/manage-apps/configure-user-consent |
| 13 | + |
| 14 | +// |
| 15 | +// IMPORTANTE NOTICE |
| 16 | +// key in $tlCfg->OAuthServers[] |
| 17 | +// can be anything you want that make this configuration |
| 18 | +// does not overwrite other or will be overwritten |
| 19 | +// |
| 20 | +// HOW TO use this file ? |
| 21 | +// 1. copy this file to |
| 22 | +// [TESTLINK_INSTALL]/cfg/ |
| 23 | +// |
| 24 | +// 2. configure according your application |
| 25 | +// |
| 26 | +// 3. add the following line to your custom_config.inc.php |
| 27 | +// require('aouth.azuread.inc.php'); |
| 28 | +// |
| 29 | +// ------------------------------------------------------------- |
| 30 | +$tlCfg->OAuthServers['azuread'] = []; |
| 31 | + |
| 32 | +$tlCfg->OAuthServers['azuread']['redirect_uri'] = (empty($_SERVER['HTTPS']) ? 'http://' : 'https://') . |
| 33 | + $_SERVER['HTTP_HOST'] . '/login.php'; |
| 34 | + |
| 35 | +$tlCfg->OAuthServers['azuread']['oauth_client_id'] = 'CHANGE_WITH_CLIENT_ID'; |
| 36 | +$tlCfg->OAuthServers['azuread']['oauth_client_secret'] = 'CHANGE_WITH_CLIENT_SECRET'; |
| 37 | + |
| 38 | +// https://login.microsoftonline.com/YOUR_TENANT_ID/v2.0/.well-known/openid-configuration |
| 39 | +$azureADBaseURL = 'https://login.microsoftonline.com/CHANGE_WITH_TENANT_ID'; |
| 40 | +$msGraphURL = 'https://graph.microsoft.com'; |
| 41 | +$tlCfg->OAuthServers['azuread']['oauth_url'] = $azureADBaseURL . |
| 42 | + '/oauth2/v2.0/authorize'; |
| 43 | + |
| 44 | +$tlCfg->OAuthServers['azuread']['token_url'] = $azureADBaseURL . |
| 45 | + '/oauth2/v2.0/token'; |
| 46 | + |
| 47 | +$tlCfg->OAuthServers['azuread']['oauth_profile'] = $msGraphURL . '/oidc/userinfo'; |
| 48 | + |
| 49 | +$tlCfg->OAuthServers['azuread']['oauth_enabled'] = true; |
| 50 | +$tlCfg->OAuthServers['azuread']['oauth_name'] = 'azuread'; // do not change this |
| 51 | +$tlCfg->OAuthServers['azuread']['oauth_force_single'] = true; |
| 52 | +$tlCfg->OAuthServers['azuread']['oauth_grant_type'] = 'authorization_code'; |
| 53 | + |
| 54 | +// the domain you want to whitelist (email domains) |
| 55 | +$tlCfg->OAuthServers['azuread']['oauth_domain'] = 'autsoft.hu'; |
| 56 | + |
| 57 | +$tlCfg->OAuthServers['azuread']['oauth_scope'] = 'https://graph.microsoft.com/mail.read https://graph.microsoft.com/user.read openid profile email'; |
0 commit comments