-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_doc_api_authentication_providers.html.txt
387 lines (331 loc) · 20.3 KB
/
_doc_api_authentication_providers.html.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
Authentication Providers API
An AuthenticationProvider object looks like:
{
// Valid for SAML providers.
"identifier_format": "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress",
// Valid for all providers.
"auth_type": "saml",
// Valid for all providers.
"id": 1649,
// Valid for SAML providers.
"log_out_url": "http://example.com/saml1/slo",
// Valid for SAML and CAS providers.
"log_in_url": "http://example.com/saml1/sli",
// Valid for SAML providers.
"certificate_fingerprint": "111222",
// Valid for SAML providers.
"requested_authn_context": null,
// Valid for LDAP providers.
"auth_host": "127.0.0.1",
// Valid for LDAP providers.
"auth_filter": "filter1",
// Valid for LDAP providers.
"auth_over_tls": null,
// Valid for LDAP and CAS providers.
"auth_base": null,
// Valid for LDAP providers.
"auth_username": "username1",
// Valid for LDAP providers.
"auth_port": null,
// Valid for all providers.
"position": 1,
// Valid for SAML providers.
"idp_entity_id": "http://example.com/saml1",
// Valid for SAML providers.
"login_attribute": "nameid",
// Valid for SAML providers.
"sig_alg": "http://www.w3.org/2001/04/xmldsig-more#rsa-sha256",
// Just In Time provisioning. Valid for all providers except Canvas (which has
// the similar in concept self_registration setting).
"jit_provisioning": null,
"federated_attributes": null,
// If multi-factor authentication is required when logging in with this
// authentication provider. The account must not have MFA disabled.
"mfa_required": null
}
A SSOSettings object looks like:
// Settings that are applicable across an account's authentication
// configuration, even if there are multiple individual providers
{
// The label used for unique login identifiers.
"login_handle_name": "Username",
// The url to redirect users to for password resets. Leave blank for default
// Canvas behavior
"change_password_url": "https://example.com/reset_password",
// If a discovery url is set, canvas will forward all users to that URL when
// they need to be authenticated. That page will need to then help the user
// figure out where they need to go to log in. If no discovery url is
// configured, the first configuration will be used to attempt to authenticate
// the user.
"auth_discovery_url": "https://example.com/which_account",
// If an unknown user url is set, Canvas will forward to that url when a service
// authenticates a user, but that user does not exist in Canvas. The default
// behavior is to present an error.
"unknown_user_url": "https://example.com/register_for_canvas"
}
A FederatedAttributesConfig object looks like:
// A mapping of Canvas attribute names to attribute names that a provider may
// send, in order to update the value of these attributes when a user logs in.
// The values can be a FederatedAttributeConfig, or a raw string corresponding
// to the "attribute" property of a FederatedAttributeConfig. In responses, full
// FederatedAttributeConfig objects are returned if JIT provisioning is enabled,
// otherwise just the attribute names are returned.
{
// A comma separated list of role names to grant to the user. Note that these
// only apply at the root account level, and not sub-accounts. If the attribute
// is not marked for provisioning only, the user will also be removed from any
// other roles they currently hold that are not still specified by the IdP.
"admin_roles": null,
// The full display name of the user
"display_name": null,
// The user's e-mail address
"email": null,
// The first, or given, name of the user
"given_name": null,
// The secondary unique identifier for SIS purposes
"integration_id": null,
// The user's preferred locale/language
"locale": null,
// The full name of the user
"name": null,
// The unique SIS identifier
"sis_user_id": null,
// The full name of the user for sorting purposes
"sortable_name": null,
// The surname, or last name, of the user
"surname": null,
// The user's preferred time zone
"timezone": null
}
A FederatedAttributeConfig object looks like:
// A single attribute name to be federated when a user logs in
{
// The name of the attribute as it will be sent from the authentication provider
"attribute": "mail",
// If the attribute should be applied only when provisioning a new user, rather
// than all logins
"provisioning_only": false
}
List authentication providersAuthenticationProvidersController#index
GET /api/v1/accounts/:account_id/authentication_providers
Returns a paginated list of authentication providers
curl 'https://<canvas>/api/v1/accounts/<account_id>/authentication_providers' \
-H 'Authorization: Bearer <token>'
Add authentication providerAuthenticationProvidersController#create
POST /api/v1/accounts/:account_id/authentication_providers
Add external authentication provider(s) for the account. Services may be Apple, CAS, Facebook, GitHub, Google, LDAP, LinkedIn, Microsoft, OpenID Connect, SAML, or Twitter.
Each authentication provider is specified as a set of parameters as described below. A provider specification must include an âauth_typeâ parameter with a value of âappleâ, âcanvasâ, âcasâ, âcleverâ, âfacebookâ, âgithubâ, âgoogleâ, âldapâ, âlinkedinâ, âmicrosoftâ, âopenid_connectâ, âsamlâ, or âtwitterâ. The other recognized parameters depend on this auth_type; unrecognized parameters are discarded. Provider specifications not specifying a valid auth_type are ignored.
You can set the âpositionâ for any provider. The config in the 1st position is considered the default. You can set âjit_provisioningâ for any provider besides Canvas. You can set âmfa_requiredâ for any provider.
For Apple, the additional recognized parameters are:
client_id [Required]
The developerâs client identifier, as provided by WWDR. Not available if configured globally for Canvas.
login_attribute [Optional]
The attribute to use to look up the userâs login in Canvas. Either âsubâ (the default), or âemailâ
federated_attributes [Optional]
See FederatedAttributesConfig. Valid provider attributes are âemailâ, âfirstNameâ, âlastNameâ, and âsubâ.
For Canvas, the additional recognized parameter is:
self_registration
âallâ, ânoneâ, or âobserverâ - who is allowed to register as a new user
For CAS, the additional recognized parameters are:
auth_base
The CAS serverâs URL.
log_in_url [Optional]
An alternate SSO URL for logging into CAS. You probably should not set this.
For Clever, the additional recognized parameters are:
client_id [Required]
The Clever applicationâs Client ID. Not available if configured globally for Canvas.
client_secret [Required]
The Clever applicationâs Client Secret. Not available if configured globally for Canvas.
district_id [Optional]
A districtâs Clever ID. Leave this blank to let Clever handle the details with its District Picker. This is required for Clever Instant Login to work in a multi-tenant environment.
login_attribute [Optional]
The attribute to use to look up the userâs login in Canvas. Either âidâ (the default), âsis_idâ, âemailâ, âstudent_numberâ, or âteacher_numberâ. Note that some fields may not be populated for all users at Clever.
federated_attributes [Optional]
See FederatedAttributesConfig. Valid provider attributes are âidâ, âsis_idâ, âemailâ, âstudent_numberâ, and âteacher_numberâ.
For Facebook, the additional recognized parameters are:
app_id [Required]
The Facebook App ID. Not available if configured globally for Canvas.
app_secret [Required]
The Facebook App Secret. Not available if configured globally for Canvas.
login_attribute [Optional]
The attribute to use to look up the userâs login in Canvas. Either âidâ (the default), or âemailâ
federated_attributes [Optional]
See FederatedAttributesConfig. Valid provider attributes are âemailâ, âfirst_nameâ, âidâ, âlast_nameâ, âlocaleâ, and ânameâ.
For GitHub, the additional recognized parameters are:
domain [Optional]
The domain of a GitHub Enterprise installation. I.e. github.mycompany.com. If not set, it will default to the public github.com.
client_id [Required]
The GitHub applicationâs Client ID. Not available if configured globally for Canvas.
client_secret [Required]
The GitHub applicationâs Client Secret. Not available if configured globally for Canvas.
login_attribute [Optional]
The attribute to use to look up the userâs login in Canvas. Either âidâ (the default), or âloginâ
federated_attributes [Optional]
See FederatedAttributesConfig. Valid provider attributes are âemailâ, âidâ, âloginâ, and ânameâ.
For Google, the additional recognized parameters are:
client_id [Required]
The Google applicationâs Client ID. Not available if configured globally for Canvas.
client_secret [Required]
The Google applicationâs Client Secret. Not available if configured globally for Canvas.
hosted_domain [Optional]
A Google Apps domain to restrict logins to. Seedevelopers.google.com/identity/protocols/OpenIDConnect?hl=en#hd-param
login_attribute [Optional]
The attribute to use to look up the userâs login in Canvas. Either âsubâ (the default), or âemailâ
federated_attributes [Optional]
See FederatedAttributesConfig. Valid provider attributes are âemailâ, âfamily_nameâ, âgiven_nameâ, âlocaleâ, ânameâ, and âsubâ.
For LDAP, the additional recognized parameters are:
auth_host
The LDAP serverâs URL.
auth_port [Optional, Integer]
The LDAP serverâs TCP port. (default: 389)
auth_over_tls [Optional]
Whether to use TLS. Can be âsimple_tlsâ, or âstart_tlsâ. For backwards compatibility, booleans are also accepted, with true meaning simple_tls. If not provided, it will default to start_tls.
auth_base [Optional]
A default treebase parameter for searches performed against the LDAP server.
auth_filter
LDAP search filter. Use {{login}} as a placeholder for the username supplied by the user. For example: â(sAMAccountName={{login}})â.
identifier_format [Optional]
The LDAP attribute to use to look up the Canvas login. Omit to use the username supplied by the user.
auth_username
Username
auth_password
Password
For LinkedIn, the additional recognized parameters are:
client_id [Required]
The LinkedIn applicationâs Client ID. Not available if configured globally for Canvas.
client_secret [Required]
The LinkedIn applicationâs Client Secret. Not available if configured globally for Canvas.
login_attribute [Optional]
The attribute to use to look up the userâs login in Canvas. Either âidâ (the default), or âemailAddressâ
federated_attributes [Optional]
See FederatedAttributesConfig. Valid provider attributes are âemailAddressâ, âfirstNameâ, âidâ, âformattedNameâ, and âlastNameâ.
For Microsoft, the additional recognized parameters are:
application_id [Required]
The applicationâs ID.
application_secret [Required]
The applicationâs Client Secret (Password)
tenant [Optional]
Seeazure.microsoft.com/en-us/documentation/articles/active-directory-v2-protocols/ Valid values are âcommonâ, âorganizationsâ, âconsumersâ, or an Azure Active Directory Tenant (as either a UUID or domain, such as contoso.onmicrosoft.com). Defaults to âcommonâ
login_attribute [Optional]
Seeazure.microsoft.com/en-us/documentation/articles/active-directory-v2-tokens/#idtokensValid values are âsubâ, âemailâ, âoidâ, or âpreferred_usernameâ. Note that email may not always be populated in the userâs profile at Microsoft. Oid will not be populated for personal Microsoft accounts. Defaults to âsubâ
federated_attributes [Optional]
See FederatedAttributesConfig. Valid provider attributes are âemailâ, ânameâ, âpreferred_usernameâ, âoidâ, and âsubâ.
For OpenID Connect, the additional recognized parameters are:
client_id [Required]
The applicationâs Client ID.
client_secret [Required]
The applicationâs Client Secret.
authorize_url [Required]
The URL for getting starting the OAuth 2.0 web flow
token_url [Required]
The URL for exchanging the OAuth 2.0 authorization code for an Access Token and ID Token
scope [Optional]
Space separated additional scopes to request for the token. Note that you need not specify the âopenidâ scope, or any scopes that can be automatically inferred by the rules defined atopenid.net/specs/openid-connect-core-1_0.html#ScopeClaims
end_session_endpoint [Optional]
URL to send the end user to after logging out of Canvas. Seeopenid.net/specs/openid-connect-session-1_0.html#RPLogout
userinfo_endpoint [Optional]
URL to request additional claims from. If the initial ID Token received from the provider cannot be used to satisfy the login_attribute and all federated_attributes, this endpoint will be queried for additional information.
login_attribute [Optional]
The attribute of the ID Token to look up the userâs login in Canvas. Defaults to âsubâ.
federated_attributes [Optional]
See FederatedAttributesConfig. Any value is allowed for the provider attribute names, but standard claims are listed atopenid.net/specs/openid-connect-core-1_0.html#StandardClaims
For SAML, the additional recognized parameters are:
metadata [Optional]
An XML document to parse as SAML metadata, and automatically populate idp_entity_id, log_in_url, log_out_url, certificate_fingerprint, and identifier_format
metadata_uri [Optional]
A URI to download the SAML metadata from, and automatically populate idp_entity_id, log_in_url, log_out_url, certificate_fingerprint, and identifier_format. This URI will also be saved, and the metadata periodically refreshed, automatically. If the metadata contains multiple entities, also supply idp_entity_id to distinguish which one you want (otherwise the only entity in the metadata will be inferred). If you provide the URI âurn:mace:incommonâ or âukfederation.org.ukâ, the InCommon or UK Access Management Federation metadata aggregate, respectively, will be used instead, and additional validation checks will happen (including validating that the metadata has been properly signed with the appropriate key).
idp_entity_id
The SAML IdPâs entity ID
log_in_url
The SAML serviceâs SSO target URL
log_out_url [Optional]
The SAML serviceâs SLO target URL
certificate_fingerprint
The SAML serviceâs certificate fingerprint.
identifier_format
The SAML serviceâs identifier format. Must be one of:
urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress
urn:oasis:names:tc:SAML:2.0:nameid-format:entity
urn:oasis:names:tc:SAML:2.0:nameid-format:kerberos
urn:oasis:names:tc:SAML:2.0:nameid-format:persistent
urn:oasis:names:tc:SAML:2.0:nameid-format:transient
urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified
urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName
urn:oasis:names:tc:SAML:1.1:nameid-format:X509SubjectName
requested_authn_context [Optional]
The SAML AuthnContext
sig_alg [Optional]
If set,AuthnRequest,LogoutRequest, andLogoutResponsemessages are signed with the corresponding algorithm. Supported algorithms are:
http://www.w3.org/2000/09/xmldsig#rsa-sha1
http://www.w3.org/2001/04/xmldsig-more#rsa-sha256
RSA-SHA1 and RSA-SHA256 are acceptable aliases.
federated_attributes [Optional]
See FederatedAttributesConfig. Any value is allowed for the provider attribute names.
For Twitter, the additional recognized parameters are:
consumer_key [Required]
The Twitter Consumer Key. Not available if configured globally for Canvas.
consumer_secret [Required]
The Twitter Consumer Secret. Not available if configured globally for Canvas.
login_attribute [Optional]
The attribute to use to look up the userâs login in Canvas. Either âuser_idâ (the default), or âscreen_nameâ
parent_registration [Optional] - DEPRECATED 2017-11-03
Accepts a boolean value, true designates the authentication service for use on parent registrations. Only one service can be selected at a time so if set to true all others will be set to false
federated_attributes [Optional]
See FederatedAttributesConfig. Valid provider attributes are ânameâ, âscreen_nameâ, âtime_zoneâ, and âuser_idâ.
# Create LDAP config
curl 'https://<canvas>/api/v1/accounts/<account_id>/authentication_providers' \
-F 'auth_type=ldap' \
-F 'auth_host=ldap.mydomain.edu' \
-F 'auth_filter=(sAMAccountName={{login}})' \
-F 'auth_username=username' \
-F 'auth_password=bestpasswordever' \
-F 'position=1' \
-H 'Authorization: Bearer <token>'
# Create SAML config
curl 'https://<canvas>/api/v1/accounts/<account_id>/authentication_providers' \
-F 'auth_type=saml' \
-F 'idp_entity_id=<idp_entity_id>' \
-F 'log_in_url=<login_url>' \
-F 'log_out_url=<logout_url>' \
-F 'certificate_fingerprint=<fingerprint>' \
-H 'Authorization: Bearer <token>'
# Create CAS config
curl 'https://<canvas>/api/v1/accounts/<account_id>/authentication_providers' \
-F 'auth_type=cas' \
-F 'auth_base=cas.mydomain.edu' \
-F 'log_in_url=<login_url>' \
-H 'Authorization: Bearer <token>'
Update authentication providerAuthenticationProvidersController#update
PUT /api/v1/accounts/:account_id/authentication_providers/:id
Update an authentication provider using the same options as the create endpoint. You can not update an existing provider to a new authentication type.
# update SAML config
curl -XPUT 'https://<canvas>/api/v1/accounts/<account_id>/authentication_providers/<id>' \
-F 'idp_entity_id=<new_idp_entity_id>' \
-F 'log_in_url=<new_url>' \
-H 'Authorization: Bearer <token>'
Get authentication providerAuthenticationProvidersController#show
GET /api/v1/accounts/:account_id/authentication_providers/:id
Get the specified authentication provider
curl 'https://<canvas>/api/v1/accounts/<account_id>/authentication_providers/<id>' \
-H 'Authorization: Bearer <token>'
Delete authentication providerAuthenticationProvidersController#destroy
DELETE /api/v1/accounts/:account_id/authentication_providers/:id
Delete the config
curl -XDELETE 'https://<canvas>/api/v1/accounts/<account_id>/authentication_providers/<id>' \
-H 'Authorization: Bearer <token>'
show account auth settingsAuthenticationProvidersController#show_sso_settings
GET /api/v1/accounts/:account_id/sso_settings
The way to get the current state of each account level setting thatâs relevant to Single Sign On configuration
You can list the current state of each setting with âupdate_sso_settingsâ
curl -XGET 'https://<canvas>/api/v1/accounts/<account_id>/sso_settings' \
-H 'Authorization: Bearer <token>'
update account auth settingsAuthenticationProvidersController#update_sso_settings
PUT /api/v1/accounts/:account_id/sso_settings
For various cases of mixed SSO configurations, you may need to set some configuration at the account level to handle the particulars of your setup.
This endpoint accepts a PUT request to set several possible account settings. All setting are optional on each request, any that are not provided at all are simply retained as is. Any that provide the key but a null-ish value (blank string, null, undefined) will be UN-set.
You can list the current state of each setting with âshow_sso_settingsâ
curl -XPUT 'https://<canvas>/api/v1/accounts/<account_id>/sso_settings' \
-F 'sso_settings[auth_discovery_url]=<new_url>' \
-F 'sso_settings[change_password_url]=<new_url>' \
-F 'sso_settings[login_handle_name]=<new_handle>' \
-H 'Authorization: Bearer <token>'