1+ data "auth0_resource_server" "my-account" {
2+ identifier = " https://${ var . auth0_domain } /me/"
3+ }
4+
5+ resource "auth0_client_grant" "donor-cli-grants" {
6+ audience = data. auth0_resource_server . my-account . identifier
7+ client_id = auth0_client. donor-cli . id
8+ scopes = [
9+ // authentication methods
10+ " read:me:authentication_methods" ,
11+ " delete:me:authentication_methods" ,
12+ " update:me:authentication_methods" ,
13+ " create:me:authentication_methods" ,
14+ // factors
15+ " read:me:factors" ,
16+ // connected_accounts
17+ " create:me:connected_accounts" ,
18+ " read:me:connected_accounts" ,
19+ " delete:me:connected_accounts"
20+ ]
21+ subject_type = " user"
22+ }
23+
24+ data "auth0_client" "donor-api-client" {
25+ name = auth0_resource_server. donor_api . name
26+ }
27+
28+ /*
29+ resource "auth0_client_grant" "donor-grants" {
30+ audience = data.auth0_resource_server.my-account.identifier
31+ client_id = auth0_client.donor.id
32+ scopes = [
33+ // authentication methods
34+ "read:me:authentication_methods",
35+ "delete:me:authentication_methods",
36+ "update:me:authentication_methods",
37+ "create:me:authentication_methods",
38+ // factors
39+ "read:me:factors",
40+ // connected_accounts
41+ "create:me:connected_accounts",
42+ "read:me:connected_accounts",
43+ "delete:me:connected_accounts"
44+ ]
45+ subject_type = "user"
46+ }
47+ */
48+
49+ # # social connection to connected accounts
50+ # VISIT https://entra.microsoft.com/#view/Microsoft_AAD_RegisteredApps/ApplicationMenuBlade/~/Overview/appId/21003461-3662-430d-a8af-bc50abacfe6e/isMSAApp~/false
51+ # VISIT https://manage.auth0.com/dashboard/au/replate-prd/connections/social/con_nvtYytFItnYhBirE/settings
52+ resource "auth0_connection" "windowslive" {
53+ name = " Microsoft"
54+ strategy = " windowslive"
55+
56+ authentication {
57+ active = false
58+ }
59+
60+ connected_accounts {
61+ active = true
62+ }
63+
64+ options {
65+ client_id = var. microsoft_client_id
66+ client_secret = var. microsoft_client_secret
67+ strategy_version = 2
68+ scopes = [
69+ " signin" ,
70+ " offline_access" ,
71+ " graph_calendars" ,
72+ " graph_user"
73+ ]
74+ set_user_root_attributes = " on_each_login"
75+ }
76+ }
77+
78+ resource "auth0_connection_clients" "windowslive-clients" {
79+ connection_id = auth0_connection. windowslive . id
80+ enabled_clients = [
81+ auth0_client . donor-cli . client_id ,
82+ auth0_client . donor . client_id ,
83+ data . auth0_client . donor-api-client . client_id
84+ ]
85+ }
0 commit comments