-
Notifications
You must be signed in to change notification settings - Fork 53
Expand file tree
/
Copy pathsso.spec.ts.snap
More file actions
93 lines (80 loc) · 4.18 KB
/
sso.spec.ts.snap
File metadata and controls
93 lines (80 loc) · 4.18 KB
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
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`SSO SSO getAuthorizationUrl with a connection generates an authorize url with the connection 1`] = `"https://api.workos.dev/sso/authorize?client_id=proj_123&connection=connection_123&redirect_uri=example.com%2Fsso%2Fworkos%2Fcallback&response_type=code"`;
exports[`SSO SSO getAuthorizationUrl with a custom api hostname generates an authorize url with the custom api hostname 1`] = `"https://api.workos.dev/sso/authorize?client_id=proj_123&domain=lyft.com&redirect_uri=example.com%2Fsso%2Fworkos%2Fcallback&response_type=code"`;
exports[`SSO SSO getAuthorizationUrl with a provider generates an authorize url with the provider 1`] = `"https://api.workos.dev/sso/authorize?client_id=proj_123&provider=Google&redirect_uri=example.com%2Fsso%2Fworkos%2Fcallback&response_type=code"`;
exports[`SSO SSO getAuthorizationUrl with an \`organization\` generates an authorization URL with the organization 1`] = `"https://api.workos.dev/sso/authorize?client_id=proj_123&organization=organization_123&redirect_uri=example.com%2Fsso%2Fworkos%2Fcallback&response_type=code"`;
exports[`SSO SSO getAuthorizationUrl with no custom api hostname generates an authorize url with the default api hostname 1`] = `"https://api.workos.com/sso/authorize?client_id=proj_123&domain=lyft.com&redirect_uri=example.com%2Fsso%2Fworkos%2Fcallback&response_type=code"`;
exports[`SSO SSO getAuthorizationUrl with no domain or provider throws an error for incomplete arguments 1`] = `"Incomplete arguments. Need to specify either a 'connection', 'organization', 'domain', or 'provider'."`;
exports[`SSO SSO getAuthorizationUrl with state generates an authorize url with the provided state 1`] = `"https://api.workos.com/sso/authorize?client_id=proj_123&domain=lyft.com&redirect_uri=example.com%2Fsso%2Fworkos%2Fcallback&response_type=code&state=custom+state"`;
exports[`SSO SSO getProfileAndToken with all information provided sends a request to the WorkOS api for a profile 1`] = `"client_id=proj_123&client_secret=sk_test_Sz3IQjepeSWaI4cMS4ms4sMuU&grant_type=authorization_code&code=authorization_code"`;
exports[`SSO SSO getProfileAndToken with all information provided sends a request to the WorkOS api for a profile 2`] = `
{
"Accept": "application/json, text/plain, */*",
"Authorization": "Bearer sk_test_Sz3IQjepeSWaI4cMS4ms4sMuU",
"Content-Type": "application/x-www-form-urlencoded;charset=utf-8",
"User-Agent": "workos-node/7.60.0/fetch",
}
`;
exports[`SSO SSO getProfileAndToken with all information provided sends a request to the WorkOS api for a profile 3`] = `
{
"connectionId": "conn_123",
"connectionType": "OktaSAML",
"customAttributes": {
"license": "professional",
},
"email": "foo@test.com",
"firstName": "foo",
"groups": [
"Admins",
"Developers",
],
"id": "prof_123",
"idpId": "123",
"lastName": "bar",
"organizationId": "org_123",
"rawAttributes": {
"email": "foo@test.com",
"first_name": "foo",
"groups": [
"Admins",
"Developers",
],
"last_name": "bar",
"license": "professional",
},
"role": {
"slug": "admin",
},
}
`;
exports[`SSO SSO getProfileAndToken without a groups attribute sends a request to the WorkOS api for a profile 1`] = `"client_id=proj_123&client_secret=sk_test_Sz3IQjepeSWaI4cMS4ms4sMuU&grant_type=authorization_code&code=authorization_code"`;
exports[`SSO SSO getProfileAndToken without a groups attribute sends a request to the WorkOS api for a profile 2`] = `
{
"Accept": "application/json, text/plain, */*",
"Authorization": "Bearer sk_test_Sz3IQjepeSWaI4cMS4ms4sMuU",
"Content-Type": "application/x-www-form-urlencoded;charset=utf-8",
"User-Agent": "workos-node/7.60.0/fetch",
}
`;
exports[`SSO SSO getProfileAndToken without a groups attribute sends a request to the WorkOS api for a profile 3`] = `
{
"connectionId": "conn_123",
"connectionType": "OktaSAML",
"customAttributes": {},
"email": "foo@test.com",
"firstName": "foo",
"groups": undefined,
"id": "prof_123",
"idpId": "123",
"lastName": "bar",
"organizationId": "org_123",
"rawAttributes": {
"email": "foo@test.com",
"first_name": "foo",
"last_name": "bar",
},
"role": {
"slug": "admin",
},
}
`;