stytch 6.0.0 → 6.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/stytch/b2b_client.rb +5 -1
- data/lib/stytch/b2b_discovery.rb +14 -3
- data/lib/stytch/b2b_magic_links.rb +9 -4
- data/lib/stytch/b2b_oauth.rb +202 -0
- data/lib/stytch/b2b_organizations.rb +49 -8
- data/lib/stytch/b2b_otp.rb +72 -0
- data/lib/stytch/b2b_passwords.rb +20 -5
- data/lib/stytch/b2b_sessions.rb +12 -4
- data/lib/stytch/b2b_sso.rb +16 -6
- data/lib/stytch/magic_links.rb +3 -3
- data/lib/stytch/otps.rb +6 -6
- data/lib/stytch/passwords.rb +2 -2
- data/lib/stytch/sessions.rb +6 -3
- data/lib/stytch/users.rb +8 -4
- data/lib/stytch/version.rb +1 -1
- data/lib/stytch.rb +1 -0
- metadata +4 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 734345852cfe96eb50bcbb218b9757310c0f324b1326b96488cff983d4b4cc29
|
|
4
|
+
data.tar.gz: 62be1b92820bf7ef7cba5a0956bcdab696e13aee6f69acb0f68de9ae17f7b134
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 58db37330e6d76f2d95747a678f5de69ce5e831b2e293bf5e316fc5afb130a303399fdf3d64fb2e2ee1efc4f3c219712b9e06a3c3b34ffda7549ebdbac9fedf3
|
|
7
|
+
data.tar.gz: 4cf8c4f8201e6717594a64d68584fd073f18b52674df440c1f53add007ac1a0f8f7867c99b5889984a587fff291ab75231fb5b470037b08ab9600a46307118e8
|
data/lib/stytch/b2b_client.rb
CHANGED
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
require_relative 'b2b_discovery'
|
|
4
4
|
require_relative 'b2b_magic_links'
|
|
5
|
+
require_relative 'b2b_oauth'
|
|
5
6
|
require_relative 'b2b_organizations'
|
|
7
|
+
require_relative 'b2b_otp'
|
|
6
8
|
require_relative 'b2b_passwords'
|
|
7
9
|
require_relative 'b2b_sessions'
|
|
8
10
|
require_relative 'b2b_sso'
|
|
@@ -11,7 +13,7 @@ module StytchB2B
|
|
|
11
13
|
class Client
|
|
12
14
|
ENVIRONMENTS = %i[live test].freeze
|
|
13
15
|
|
|
14
|
-
attr_reader :discovery, :magic_links, :organizations, :passwords, :sso, :sessions
|
|
16
|
+
attr_reader :discovery, :magic_links, :oauth, :otps, :organizations, :passwords, :sso, :sessions
|
|
15
17
|
|
|
16
18
|
def initialize(project_id:, secret:, env: nil, &block)
|
|
17
19
|
@api_host = api_host(env, project_id)
|
|
@@ -22,6 +24,8 @@ module StytchB2B
|
|
|
22
24
|
|
|
23
25
|
@discovery = StytchB2B::Discovery.new(@connection)
|
|
24
26
|
@magic_links = StytchB2B::MagicLinks.new(@connection)
|
|
27
|
+
@oauth = StytchB2B::OAuth.new(@connection)
|
|
28
|
+
@otps = StytchB2B::OTPs.new(@connection)
|
|
25
29
|
@organizations = StytchB2B::Organizations.new(@connection)
|
|
26
30
|
@passwords = StytchB2B::Passwords.new(@connection)
|
|
27
31
|
@sso = StytchB2B::SSO.new(@connection)
|
data/lib/stytch/b2b_discovery.rb
CHANGED
|
@@ -57,6 +57,9 @@ module StytchB2B
|
|
|
57
57
|
# delete a key, supply a null value. Custom claims made with reserved claims (`iss`, `sub`, `aud`, `exp`, `nbf`, `iat`, `jti`) will be ignored.
|
|
58
58
|
# Total custom claims size cannot exceed four kilobytes.
|
|
59
59
|
# The type of this field is nilable +object+.
|
|
60
|
+
# locale::
|
|
61
|
+
# (no documentation yet)
|
|
62
|
+
# The type of this field is nilable +ExchangeRequestLocale+ (string enum).
|
|
60
63
|
#
|
|
61
64
|
# == Returns:
|
|
62
65
|
# An object with the following fields:
|
|
@@ -88,7 +91,8 @@ module StytchB2B
|
|
|
88
91
|
intermediate_session_token:,
|
|
89
92
|
organization_id:,
|
|
90
93
|
session_duration_minutes: nil,
|
|
91
|
-
session_custom_claims: nil
|
|
94
|
+
session_custom_claims: nil,
|
|
95
|
+
locale: nil
|
|
92
96
|
)
|
|
93
97
|
request = {
|
|
94
98
|
intermediate_session_token: intermediate_session_token,
|
|
@@ -96,6 +100,7 @@ module StytchB2B
|
|
|
96
100
|
}
|
|
97
101
|
request[:session_duration_minutes] = session_duration_minutes unless session_duration_minutes.nil?
|
|
98
102
|
request[:session_custom_claims] = session_custom_claims unless session_custom_claims.nil?
|
|
103
|
+
request[:locale] = locale unless locale.nil?
|
|
99
104
|
|
|
100
105
|
post_request('/v1/b2b/discovery/intermediate_sessions/exchange', request)
|
|
101
106
|
end
|
|
@@ -197,6 +202,9 @@ module StytchB2B
|
|
|
197
202
|
# The list's accepted values are: `sso`, `magic_link`, `password`, `google_oauth`, and `microsoft_oauth`.
|
|
198
203
|
#
|
|
199
204
|
# The type of this field is nilable list of +String+.
|
|
205
|
+
# mfa_policy::
|
|
206
|
+
# (no documentation yet)
|
|
207
|
+
# The type of this field is nilable +String+.
|
|
200
208
|
#
|
|
201
209
|
# == Returns:
|
|
202
210
|
# An object with the following fields:
|
|
@@ -237,7 +245,8 @@ module StytchB2B
|
|
|
237
245
|
email_jit_provisioning: nil,
|
|
238
246
|
email_invites: nil,
|
|
239
247
|
auth_methods: nil,
|
|
240
|
-
allowed_auth_methods: nil
|
|
248
|
+
allowed_auth_methods: nil,
|
|
249
|
+
mfa_policy: nil
|
|
241
250
|
)
|
|
242
251
|
request = {
|
|
243
252
|
intermediate_session_token: intermediate_session_token,
|
|
@@ -254,6 +263,7 @@ module StytchB2B
|
|
|
254
263
|
request[:email_invites] = email_invites unless email_invites.nil?
|
|
255
264
|
request[:auth_methods] = auth_methods unless auth_methods.nil?
|
|
256
265
|
request[:allowed_auth_methods] = allowed_auth_methods unless allowed_auth_methods.nil?
|
|
266
|
+
request[:mfa_policy] = mfa_policy unless mfa_policy.nil?
|
|
257
267
|
|
|
258
268
|
post_request('/v1/b2b/discovery/organizations/create', request)
|
|
259
269
|
end
|
|
@@ -313,7 +323,8 @@ module StytchB2B
|
|
|
313
323
|
session_token: nil,
|
|
314
324
|
session_jwt: nil
|
|
315
325
|
)
|
|
316
|
-
request = {
|
|
326
|
+
request = {
|
|
327
|
+
}
|
|
317
328
|
request[:intermediate_session_token] = intermediate_session_token unless intermediate_session_token.nil?
|
|
318
329
|
request[:session_token] = session_token unless session_token.nil?
|
|
319
330
|
request[:session_jwt] = session_jwt unless session_jwt.nil?
|
|
@@ -57,6 +57,9 @@ module StytchB2B
|
|
|
57
57
|
# delete a key, supply a null value. Custom claims made with reserved claims (`iss`, `sub`, `aud`, `exp`, `nbf`, `iat`, `jti`) will be ignored.
|
|
58
58
|
# Total custom claims size cannot exceed four kilobytes.
|
|
59
59
|
# The type of this field is nilable +object+.
|
|
60
|
+
# locale::
|
|
61
|
+
# (no documentation yet)
|
|
62
|
+
# The type of this field is nilable +AuthenticateRequestLocale+ (string enum).
|
|
60
63
|
#
|
|
61
64
|
# == Returns:
|
|
62
65
|
# An object with the following fields:
|
|
@@ -100,7 +103,8 @@ module StytchB2B
|
|
|
100
103
|
session_token: nil,
|
|
101
104
|
session_jwt: nil,
|
|
102
105
|
session_duration_minutes: nil,
|
|
103
|
-
session_custom_claims: nil
|
|
106
|
+
session_custom_claims: nil,
|
|
107
|
+
locale: nil
|
|
104
108
|
)
|
|
105
109
|
request = {
|
|
106
110
|
magic_links_token: magic_links_token
|
|
@@ -110,6 +114,7 @@ module StytchB2B
|
|
|
110
114
|
request[:session_jwt] = session_jwt unless session_jwt.nil?
|
|
111
115
|
request[:session_duration_minutes] = session_duration_minutes unless session_duration_minutes.nil?
|
|
112
116
|
request[:session_custom_claims] = session_custom_claims unless session_custom_claims.nil?
|
|
117
|
+
request[:locale] = locale unless locale.nil?
|
|
113
118
|
|
|
114
119
|
post_request('/v1/b2b/magic_links/authenticate', request)
|
|
115
120
|
end
|
|
@@ -161,7 +166,7 @@ module StytchB2B
|
|
|
161
166
|
#
|
|
162
167
|
# Request support for additional languages [here](https://docs.google.com/forms/d/e/1FAIpQLScZSpAu_m2AmLXRT3F3kap-s_mcV6UTBitYn6CdyWP0-o7YjQ/viewform?usp=sf_link")!
|
|
163
168
|
#
|
|
164
|
-
# The type of this field is nilable +LoginOrSignupRequestLocale+ (
|
|
169
|
+
# The type of this field is nilable +LoginOrSignupRequestLocale+ (string enum).
|
|
165
170
|
#
|
|
166
171
|
# == Returns:
|
|
167
172
|
# An object with the following fields:
|
|
@@ -246,7 +251,7 @@ module StytchB2B
|
|
|
246
251
|
#
|
|
247
252
|
# Request support for additional languages [here](https://docs.google.com/forms/d/e/1FAIpQLScZSpAu_m2AmLXRT3F3kap-s_mcV6UTBitYn6CdyWP0-o7YjQ/viewform?usp=sf_link")!
|
|
248
253
|
#
|
|
249
|
-
# The type of this field is nilable +InviteRequestLocale+ (
|
|
254
|
+
# The type of this field is nilable +InviteRequestLocale+ (string enum).
|
|
250
255
|
#
|
|
251
256
|
# == Returns:
|
|
252
257
|
# An object with the following fields:
|
|
@@ -323,7 +328,7 @@ module StytchB2B
|
|
|
323
328
|
#
|
|
324
329
|
# Request support for additional languages [here](https://docs.google.com/forms/d/e/1FAIpQLScZSpAu_m2AmLXRT3F3kap-s_mcV6UTBitYn6CdyWP0-o7YjQ/viewform?usp=sf_link")!
|
|
325
330
|
#
|
|
326
|
-
# The type of this field is nilable +SendRequestLocale+ (
|
|
331
|
+
# The type of this field is nilable +SendRequestLocale+ (string enum).
|
|
327
332
|
#
|
|
328
333
|
# == Returns:
|
|
329
334
|
# An object with the following fields:
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# !!!
|
|
4
|
+
# WARNING: This file is autogenerated
|
|
5
|
+
# Only modify code within MANUAL() sections
|
|
6
|
+
# or your changes may be overwritten later!
|
|
7
|
+
# !!!
|
|
8
|
+
|
|
9
|
+
require_relative 'request_helper'
|
|
10
|
+
|
|
11
|
+
module StytchB2B
|
|
12
|
+
class OAuth
|
|
13
|
+
include Stytch::RequestHelper
|
|
14
|
+
attr_reader :discovery
|
|
15
|
+
|
|
16
|
+
def initialize(connection)
|
|
17
|
+
@connection = connection
|
|
18
|
+
|
|
19
|
+
@discovery = StytchB2B::OAuth::Discovery.new(@connection)
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
# Authenticate a Member given a `token`. This endpoint verifies that the member completed the OAuth flow by verifying that the token is valid and hasn't expired. Provide the `session_duration_minutes` parameter to set the lifetime of the session. If the `session_duration_minutes` parameter is not specified, a Stytch session will be created with a 60 minute duration.
|
|
23
|
+
#
|
|
24
|
+
# == Parameters:
|
|
25
|
+
# oauth_token::
|
|
26
|
+
# The token to authenticate.
|
|
27
|
+
# The type of this field is +String+.
|
|
28
|
+
# session_token::
|
|
29
|
+
# A secret token for a given Stytch Session.
|
|
30
|
+
# The type of this field is nilable +String+.
|
|
31
|
+
# session_duration_minutes::
|
|
32
|
+
# Set the session lifetime to be this many minutes from now. This will start a new session if one doesn't already exist,
|
|
33
|
+
# returning both an opaque `session_token` and `session_jwt` for this session. Remember that the `session_jwt` will have a fixed lifetime of
|
|
34
|
+
# five minutes regardless of the underlying session duration, and will need to be refreshed over time.
|
|
35
|
+
#
|
|
36
|
+
# This value must be a minimum of 5 and a maximum of 527040 minutes (366 days).
|
|
37
|
+
#
|
|
38
|
+
# If a `session_token` or `session_jwt` is provided then a successful authentication will continue to extend the session this many minutes.
|
|
39
|
+
#
|
|
40
|
+
# If the `session_duration_minutes` parameter is not specified, a Stytch session will be created with a 60 minute duration. If you don't want
|
|
41
|
+
# to use the Stytch session product, you can ignore the session fields in the response.
|
|
42
|
+
# The type of this field is nilable +Integer+.
|
|
43
|
+
# session_jwt::
|
|
44
|
+
# The JSON Web Token (JWT) for a given Stytch Session.
|
|
45
|
+
# The type of this field is nilable +String+.
|
|
46
|
+
# session_custom_claims::
|
|
47
|
+
# Add a custom claims map to the Session being authenticated. Claims are only created if a Session is initialized by providing a value in
|
|
48
|
+
# `session_duration_minutes`. Claims will be included on the Session object and in the JWT. To update a key in an existing Session, supply a new value. To
|
|
49
|
+
# delete a key, supply a null value. Custom claims made with reserved claims (`iss`, `sub`, `aud`, `exp`, `nbf`, `iat`, `jti`) will be ignored.
|
|
50
|
+
# Total custom claims size cannot exceed four kilobytes.
|
|
51
|
+
# The type of this field is nilable +object+.
|
|
52
|
+
# pkce_code_verifier::
|
|
53
|
+
# A base64url encoded one time secret used to validate that the request starts and ends on the same device.
|
|
54
|
+
# The type of this field is nilable +String+.
|
|
55
|
+
# locale::
|
|
56
|
+
# (no documentation yet)
|
|
57
|
+
# The type of this field is nilable +AuthenticateRequestLocale+ (string enum).
|
|
58
|
+
#
|
|
59
|
+
# == Returns:
|
|
60
|
+
# An object with the following fields:
|
|
61
|
+
# request_id::
|
|
62
|
+
# Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue.
|
|
63
|
+
# The type of this field is +String+.
|
|
64
|
+
# member_id::
|
|
65
|
+
# Globally unique UUID that identifies a specific Member.
|
|
66
|
+
# The type of this field is +String+.
|
|
67
|
+
# provider_subject::
|
|
68
|
+
# (no documentation yet)
|
|
69
|
+
# The type of this field is +String+.
|
|
70
|
+
# provider_type::
|
|
71
|
+
# (no documentation yet)
|
|
72
|
+
# The type of this field is +String+.
|
|
73
|
+
# session_token::
|
|
74
|
+
# A secret token for a given Stytch Session.
|
|
75
|
+
# The type of this field is +String+.
|
|
76
|
+
# session_jwt::
|
|
77
|
+
# The JSON Web Token (JWT) for a given Stytch Session.
|
|
78
|
+
# The type of this field is +String+.
|
|
79
|
+
# member::
|
|
80
|
+
# The [Member object](https://stytch.com/docs/b2b/api/member-object).
|
|
81
|
+
# The type of this field is +Member+ (+object+).
|
|
82
|
+
# organization_id::
|
|
83
|
+
# Globally unique UUID that identifies a specific Organization. The `organization_id` is critical to perform operations on an Organization, so be sure to preserve this value.
|
|
84
|
+
# The type of this field is +String+.
|
|
85
|
+
# organization::
|
|
86
|
+
# The [Organization object](https://stytch.com/docs/b2b/api/organization-object).
|
|
87
|
+
# The type of this field is +Organization+ (+object+).
|
|
88
|
+
# reset_sessions::
|
|
89
|
+
# (no documentation yet)
|
|
90
|
+
# The type of this field is +Boolean+.
|
|
91
|
+
# status_code::
|
|
92
|
+
# The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors.
|
|
93
|
+
# The type of this field is +Integer+.
|
|
94
|
+
# member_session::
|
|
95
|
+
# The [Session object](https://stytch.com/docs/b2b/api/session-object).
|
|
96
|
+
# The type of this field is nilable +MemberSession+ (+object+).
|
|
97
|
+
# provider_values::
|
|
98
|
+
# The `provider_values` object lists relevant identifiers, values, and scopes for a given OAuth provider. For example this object will include a provider's `access_token` that you can use to access the provider's API for a given user.
|
|
99
|
+
#
|
|
100
|
+
# Note that these values will vary based on the OAuth provider in question, e.g. `id_token` is only returned by Microsoft.
|
|
101
|
+
# The type of this field is nilable +ProviderValues+ (+object+).
|
|
102
|
+
def authenticate(
|
|
103
|
+
oauth_token:,
|
|
104
|
+
session_token: nil,
|
|
105
|
+
session_duration_minutes: nil,
|
|
106
|
+
session_jwt: nil,
|
|
107
|
+
session_custom_claims: nil,
|
|
108
|
+
pkce_code_verifier: nil,
|
|
109
|
+
locale: nil
|
|
110
|
+
)
|
|
111
|
+
request = {
|
|
112
|
+
oauth_token: oauth_token
|
|
113
|
+
}
|
|
114
|
+
request[:session_token] = session_token unless session_token.nil?
|
|
115
|
+
request[:session_duration_minutes] = session_duration_minutes unless session_duration_minutes.nil?
|
|
116
|
+
request[:session_jwt] = session_jwt unless session_jwt.nil?
|
|
117
|
+
request[:session_custom_claims] = session_custom_claims unless session_custom_claims.nil?
|
|
118
|
+
request[:pkce_code_verifier] = pkce_code_verifier unless pkce_code_verifier.nil?
|
|
119
|
+
request[:locale] = locale unless locale.nil?
|
|
120
|
+
|
|
121
|
+
post_request('/v1/b2b/oauth/authenticate', request)
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
class Discovery
|
|
125
|
+
include Stytch::RequestHelper
|
|
126
|
+
|
|
127
|
+
def initialize(connection)
|
|
128
|
+
@connection = connection
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
# Authenticates the Discovery OAuth token and exchanges it for an Intermediate Session Token. Intermediate Session Tokens can be used for various Discovery login flows and are valid for 10 minutes.
|
|
132
|
+
#
|
|
133
|
+
# == Parameters:
|
|
134
|
+
# discovery_oauth_token::
|
|
135
|
+
# The Discovery OAuth token to authenticate.
|
|
136
|
+
# The type of this field is +String+.
|
|
137
|
+
# session_token::
|
|
138
|
+
# (no documentation yet)
|
|
139
|
+
# The type of this field is nilable +String+.
|
|
140
|
+
# session_duration_minutes::
|
|
141
|
+
# (no documentation yet)
|
|
142
|
+
# The type of this field is nilable +Integer+.
|
|
143
|
+
# session_jwt::
|
|
144
|
+
# (no documentation yet)
|
|
145
|
+
# The type of this field is nilable +String+.
|
|
146
|
+
# session_custom_claims::
|
|
147
|
+
# (no documentation yet)
|
|
148
|
+
# The type of this field is nilable +object+.
|
|
149
|
+
# pkce_code_verifier::
|
|
150
|
+
# A base64url encoded one time secret used to validate that the request starts and ends on the same device.
|
|
151
|
+
# The type of this field is nilable +String+.
|
|
152
|
+
#
|
|
153
|
+
# == Returns:
|
|
154
|
+
# An object with the following fields:
|
|
155
|
+
# request_id::
|
|
156
|
+
# Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue.
|
|
157
|
+
# The type of this field is +String+.
|
|
158
|
+
# intermediate_session_token::
|
|
159
|
+
# The Intermediate Session Token. This token does not belong to a specific instance of a member, but may be exchanged for an existing Member Session or used to create a new organization.
|
|
160
|
+
# The type of this field is +String+.
|
|
161
|
+
# email_address::
|
|
162
|
+
# The email address.
|
|
163
|
+
# The type of this field is +String+.
|
|
164
|
+
# discovered_organizations::
|
|
165
|
+
# An array of `discovered_organization` objects tied to the `intermediate_session_token`, `session_token`, or `session_jwt`. See the [Discovered Organization Object](https://stytch.com/docs/b2b/api/discovered-organization-object) for complete details.
|
|
166
|
+
#
|
|
167
|
+
# Note that Organizations will only appear here under any of the following conditions:
|
|
168
|
+
# 1. The end user is already a Member of the Organization.
|
|
169
|
+
# 2. The end user is invited to the Organization.
|
|
170
|
+
# 3. The end user can join the Organization because:
|
|
171
|
+
#
|
|
172
|
+
# a) The Organization allows JIT provisioning.
|
|
173
|
+
#
|
|
174
|
+
# b) The Organizations' allowed domains list contains the Member's email domain.
|
|
175
|
+
#
|
|
176
|
+
# c) The Organization has at least one other Member with a verified email address with the same domain as the end user (to prevent phishing attacks).
|
|
177
|
+
# The type of this field is list of +DiscoveredOrganization+ (+object+).
|
|
178
|
+
# status_code::
|
|
179
|
+
# The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors.
|
|
180
|
+
# The type of this field is +Integer+.
|
|
181
|
+
def authenticate(
|
|
182
|
+
discovery_oauth_token:,
|
|
183
|
+
session_token: nil,
|
|
184
|
+
session_duration_minutes: nil,
|
|
185
|
+
session_jwt: nil,
|
|
186
|
+
session_custom_claims: nil,
|
|
187
|
+
pkce_code_verifier: nil
|
|
188
|
+
)
|
|
189
|
+
request = {
|
|
190
|
+
discovery_oauth_token: discovery_oauth_token
|
|
191
|
+
}
|
|
192
|
+
request[:session_token] = session_token unless session_token.nil?
|
|
193
|
+
request[:session_duration_minutes] = session_duration_minutes unless session_duration_minutes.nil?
|
|
194
|
+
request[:session_jwt] = session_jwt unless session_jwt.nil?
|
|
195
|
+
request[:session_custom_claims] = session_custom_claims unless session_custom_claims.nil?
|
|
196
|
+
request[:pkce_code_verifier] = pkce_code_verifier unless pkce_code_verifier.nil?
|
|
197
|
+
|
|
198
|
+
post_request('/v1/b2b/oauth/discovery/authenticate', request)
|
|
199
|
+
end
|
|
200
|
+
end
|
|
201
|
+
end
|
|
202
|
+
end
|
|
@@ -86,6 +86,9 @@ module StytchB2B
|
|
|
86
86
|
# The list's accepted values are: `sso`, `magic_link`, `password`, `google_oauth`, and `microsoft_oauth`.
|
|
87
87
|
#
|
|
88
88
|
# The type of this field is nilable list of +String+.
|
|
89
|
+
# mfa_policy::
|
|
90
|
+
# (no documentation yet)
|
|
91
|
+
# The type of this field is nilable +String+.
|
|
89
92
|
#
|
|
90
93
|
# == Returns:
|
|
91
94
|
# An object with the following fields:
|
|
@@ -108,7 +111,8 @@ module StytchB2B
|
|
|
108
111
|
email_jit_provisioning: nil,
|
|
109
112
|
email_invites: nil,
|
|
110
113
|
auth_methods: nil,
|
|
111
|
-
allowed_auth_methods: nil
|
|
114
|
+
allowed_auth_methods: nil,
|
|
115
|
+
mfa_policy: nil
|
|
112
116
|
)
|
|
113
117
|
request = {
|
|
114
118
|
organization_name: organization_name
|
|
@@ -122,6 +126,7 @@ module StytchB2B
|
|
|
122
126
|
request[:email_invites] = email_invites unless email_invites.nil?
|
|
123
127
|
request[:auth_methods] = auth_methods unless auth_methods.nil?
|
|
124
128
|
request[:allowed_auth_methods] = allowed_auth_methods unless allowed_auth_methods.nil?
|
|
129
|
+
request[:mfa_policy] = mfa_policy unless mfa_policy.nil?
|
|
125
130
|
|
|
126
131
|
post_request('/v1/b2b/organizations', request)
|
|
127
132
|
end
|
|
@@ -147,7 +152,8 @@ module StytchB2B
|
|
|
147
152
|
def get(
|
|
148
153
|
organization_id:
|
|
149
154
|
)
|
|
150
|
-
query_params = {
|
|
155
|
+
query_params = {
|
|
156
|
+
}
|
|
151
157
|
request = request_with_query_params("/v1/b2b/organizations/#{organization_id}", query_params)
|
|
152
158
|
get_request(request)
|
|
153
159
|
end
|
|
@@ -227,6 +233,9 @@ module StytchB2B
|
|
|
227
233
|
# The list's accepted values are: `sso`, `magic_link`, `password`, `google_oauth`, and `microsoft_oauth`.
|
|
228
234
|
#
|
|
229
235
|
# The type of this field is nilable list of +String+.
|
|
236
|
+
# mfa_policy::
|
|
237
|
+
# (no documentation yet)
|
|
238
|
+
# The type of this field is nilable +String+.
|
|
230
239
|
#
|
|
231
240
|
# == Returns:
|
|
232
241
|
# An object with the following fields:
|
|
@@ -252,9 +261,11 @@ module StytchB2B
|
|
|
252
261
|
email_jit_provisioning: nil,
|
|
253
262
|
email_invites: nil,
|
|
254
263
|
auth_methods: nil,
|
|
255
|
-
allowed_auth_methods: nil
|
|
264
|
+
allowed_auth_methods: nil,
|
|
265
|
+
mfa_policy: nil
|
|
256
266
|
)
|
|
257
|
-
request = {
|
|
267
|
+
request = {
|
|
268
|
+
}
|
|
258
269
|
request[:organization_name] = organization_name unless organization_name.nil?
|
|
259
270
|
request[:organization_slug] = organization_slug unless organization_slug.nil?
|
|
260
271
|
request[:organization_logo_url] = organization_logo_url unless organization_logo_url.nil?
|
|
@@ -270,6 +281,7 @@ module StytchB2B
|
|
|
270
281
|
request[:email_invites] = email_invites unless email_invites.nil?
|
|
271
282
|
request[:auth_methods] = auth_methods unless auth_methods.nil?
|
|
272
283
|
request[:allowed_auth_methods] = allowed_auth_methods unless allowed_auth_methods.nil?
|
|
284
|
+
request[:mfa_policy] = mfa_policy unless mfa_policy.nil?
|
|
273
285
|
|
|
274
286
|
put_request("/v1/b2b/organizations/#{organization_id}", request)
|
|
275
287
|
end
|
|
@@ -330,7 +342,8 @@ module StytchB2B
|
|
|
330
342
|
limit: nil,
|
|
331
343
|
query: nil
|
|
332
344
|
)
|
|
333
|
-
request = {
|
|
345
|
+
request = {
|
|
346
|
+
}
|
|
334
347
|
request[:cursor] = cursor unless cursor.nil?
|
|
335
348
|
request[:limit] = limit unless limit.nil?
|
|
336
349
|
request[:query] = query unless query.nil?
|
|
@@ -368,6 +381,12 @@ module StytchB2B
|
|
|
368
381
|
# is_breakglass::
|
|
369
382
|
# Identifies the Member as a break glass user - someone who has permissions to authenticate into an Organization by bypassing the Organization's settings. A break glass account is typically used for emergency purposes to gain access outside of normal authentication procedures. Refer to the [Organization object](organization-object) and its `auth_methods` and `allowed_auth_methods` fields for more details.
|
|
370
383
|
# The type of this field is nilable +Boolean+.
|
|
384
|
+
# phone_number::
|
|
385
|
+
# (no documentation yet)
|
|
386
|
+
# The type of this field is nilable +String+.
|
|
387
|
+
# mfa_enrolled::
|
|
388
|
+
# (no documentation yet)
|
|
389
|
+
# The type of this field is nilable +Boolean+.
|
|
371
390
|
#
|
|
372
391
|
# == Returns:
|
|
373
392
|
# An object with the following fields:
|
|
@@ -392,13 +411,18 @@ module StytchB2B
|
|
|
392
411
|
name: nil,
|
|
393
412
|
trusted_metadata: nil,
|
|
394
413
|
untrusted_metadata: nil,
|
|
395
|
-
is_breakglass: nil
|
|
414
|
+
is_breakglass: nil,
|
|
415
|
+
phone_number: nil,
|
|
416
|
+
mfa_enrolled: nil
|
|
396
417
|
)
|
|
397
|
-
request = {
|
|
418
|
+
request = {
|
|
419
|
+
}
|
|
398
420
|
request[:name] = name unless name.nil?
|
|
399
421
|
request[:trusted_metadata] = trusted_metadata unless trusted_metadata.nil?
|
|
400
422
|
request[:untrusted_metadata] = untrusted_metadata unless untrusted_metadata.nil?
|
|
401
423
|
request[:is_breakglass] = is_breakglass unless is_breakglass.nil?
|
|
424
|
+
request[:phone_number] = phone_number unless phone_number.nil?
|
|
425
|
+
request[:mfa_enrolled] = mfa_enrolled unless mfa_enrolled.nil?
|
|
402
426
|
|
|
403
427
|
put_request("/v1/b2b/organizations/#{organization_id}/members/#{member_id}", request)
|
|
404
428
|
end
|
|
@@ -431,6 +455,13 @@ module StytchB2B
|
|
|
431
455
|
delete_request("/v1/b2b/organizations/#{organization_id}/members/#{member_id}")
|
|
432
456
|
end
|
|
433
457
|
|
|
458
|
+
def delete_phone_number(
|
|
459
|
+
organization_id:,
|
|
460
|
+
member_id:
|
|
461
|
+
)
|
|
462
|
+
delete_request("/v1/b2b/organizations/#{organization_id}/members/phone_numbers/#{member_id}")
|
|
463
|
+
end
|
|
464
|
+
|
|
434
465
|
# Search for Members within specified Organizations. An array with at least one `organization_id` is required. Submitting an empty `query` returns all Members within the specified Organizations.
|
|
435
466
|
#
|
|
436
467
|
# *All fuzzy search filters require a minimum of three characters.
|
|
@@ -542,6 +573,12 @@ module StytchB2B
|
|
|
542
573
|
# is_breakglass::
|
|
543
574
|
# Identifies the Member as a break glass user - someone who has permissions to authenticate into an Organization by bypassing the Organization's settings. A break glass account is typically used for emergency purposes to gain access outside of normal authentication procedures. Refer to the [Organization object](organization-object) and its `auth_methods` and `allowed_auth_methods` fields for more details.
|
|
544
575
|
# The type of this field is nilable +Boolean+.
|
|
576
|
+
# phone_number::
|
|
577
|
+
# (no documentation yet)
|
|
578
|
+
# The type of this field is nilable +String+.
|
|
579
|
+
# mfa_enrolled::
|
|
580
|
+
# (no documentation yet)
|
|
581
|
+
# The type of this field is nilable +Boolean+.
|
|
545
582
|
#
|
|
546
583
|
# == Returns:
|
|
547
584
|
# An object with the following fields:
|
|
@@ -567,7 +604,9 @@ module StytchB2B
|
|
|
567
604
|
trusted_metadata: nil,
|
|
568
605
|
untrusted_metadata: nil,
|
|
569
606
|
create_member_as_pending: nil,
|
|
570
|
-
is_breakglass: nil
|
|
607
|
+
is_breakglass: nil,
|
|
608
|
+
phone_number: nil,
|
|
609
|
+
mfa_enrolled: nil
|
|
571
610
|
)
|
|
572
611
|
request = {
|
|
573
612
|
email_address: email_address
|
|
@@ -577,6 +616,8 @@ module StytchB2B
|
|
|
577
616
|
request[:untrusted_metadata] = untrusted_metadata unless untrusted_metadata.nil?
|
|
578
617
|
request[:create_member_as_pending] = create_member_as_pending unless create_member_as_pending.nil?
|
|
579
618
|
request[:is_breakglass] = is_breakglass unless is_breakglass.nil?
|
|
619
|
+
request[:phone_number] = phone_number unless phone_number.nil?
|
|
620
|
+
request[:mfa_enrolled] = mfa_enrolled unless mfa_enrolled.nil?
|
|
580
621
|
|
|
581
622
|
post_request("/v1/b2b/organizations/#{organization_id}/members", request)
|
|
582
623
|
end
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# !!!
|
|
4
|
+
# WARNING: This file is autogenerated
|
|
5
|
+
# Only modify code within MANUAL() sections
|
|
6
|
+
# or your changes may be overwritten later!
|
|
7
|
+
# !!!
|
|
8
|
+
|
|
9
|
+
require_relative 'request_helper'
|
|
10
|
+
|
|
11
|
+
module StytchB2B
|
|
12
|
+
class OTPs
|
|
13
|
+
include Stytch::RequestHelper
|
|
14
|
+
attr_reader :sms
|
|
15
|
+
|
|
16
|
+
def initialize(connection)
|
|
17
|
+
@connection = connection
|
|
18
|
+
|
|
19
|
+
@sms = StytchB2B::OTPs::Sms.new(@connection)
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
class Sms
|
|
23
|
+
include Stytch::RequestHelper
|
|
24
|
+
|
|
25
|
+
def initialize(connection)
|
|
26
|
+
@connection = connection
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def send(
|
|
30
|
+
organization_id:,
|
|
31
|
+
member_id:,
|
|
32
|
+
phone_number: nil,
|
|
33
|
+
locale: nil
|
|
34
|
+
)
|
|
35
|
+
request = {
|
|
36
|
+
organization_id: organization_id,
|
|
37
|
+
member_id: member_id
|
|
38
|
+
}
|
|
39
|
+
request[:phone_number] = phone_number unless phone_number.nil?
|
|
40
|
+
request[:locale] = locale unless locale.nil?
|
|
41
|
+
|
|
42
|
+
post_request('/v1/b2b/otps/sms/send', request)
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
def authenticate(
|
|
46
|
+
organization_id:,
|
|
47
|
+
member_id:,
|
|
48
|
+
code:,
|
|
49
|
+
intermediate_session_token: nil,
|
|
50
|
+
session_token: nil,
|
|
51
|
+
session_jwt: nil,
|
|
52
|
+
session_duration_minutes: nil,
|
|
53
|
+
session_custom_claims: nil,
|
|
54
|
+
set_mfa_enrollment: nil
|
|
55
|
+
)
|
|
56
|
+
request = {
|
|
57
|
+
organization_id: organization_id,
|
|
58
|
+
member_id: member_id,
|
|
59
|
+
code: code
|
|
60
|
+
}
|
|
61
|
+
request[:intermediate_session_token] = intermediate_session_token unless intermediate_session_token.nil?
|
|
62
|
+
request[:session_token] = session_token unless session_token.nil?
|
|
63
|
+
request[:session_jwt] = session_jwt unless session_jwt.nil?
|
|
64
|
+
request[:session_duration_minutes] = session_duration_minutes unless session_duration_minutes.nil?
|
|
65
|
+
request[:session_custom_claims] = session_custom_claims unless session_custom_claims.nil?
|
|
66
|
+
request[:set_mfa_enrollment] = set_mfa_enrollment unless set_mfa_enrollment.nil?
|
|
67
|
+
|
|
68
|
+
post_request('/v1/b2b/otps/sms/authenticate', request)
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
end
|
data/lib/stytch/b2b_passwords.rb
CHANGED
|
@@ -97,7 +97,7 @@ module StytchB2B
|
|
|
97
97
|
# The type of this field is +String+.
|
|
98
98
|
# hash_type::
|
|
99
99
|
# The password hash used. Currently `bcrypt`, `scrypt`, `argon2i`, `argon2id`, `md_5`, `sha_1`, and `pbkdf_2` are supported.
|
|
100
|
-
# The type of this field is +MigrateRequestHashType+ (
|
|
100
|
+
# The type of this field is +MigrateRequestHashType+ (string enum).
|
|
101
101
|
# organization_id::
|
|
102
102
|
# Globally unique UUID that identifies a specific Organization. The `organization_id` is critical to perform operations on an Organization, so be sure to preserve this value.
|
|
103
103
|
# The type of this field is +String+.
|
|
@@ -221,6 +221,9 @@ module StytchB2B
|
|
|
221
221
|
# delete a key, supply a null value. Custom claims made with reserved claims (`iss`, `sub`, `aud`, `exp`, `nbf`, `iat`, `jti`) will be ignored.
|
|
222
222
|
# Total custom claims size cannot exceed four kilobytes.
|
|
223
223
|
# The type of this field is nilable +object+.
|
|
224
|
+
# locale::
|
|
225
|
+
# (no documentation yet)
|
|
226
|
+
# The type of this field is nilable +AuthenticateRequestLocale+ (string enum).
|
|
224
227
|
#
|
|
225
228
|
# == Returns:
|
|
226
229
|
# An object with the following fields:
|
|
@@ -258,7 +261,8 @@ module StytchB2B
|
|
|
258
261
|
session_token: nil,
|
|
259
262
|
session_duration_minutes: nil,
|
|
260
263
|
session_jwt: nil,
|
|
261
|
-
session_custom_claims: nil
|
|
264
|
+
session_custom_claims: nil,
|
|
265
|
+
locale: nil
|
|
262
266
|
)
|
|
263
267
|
request = {
|
|
264
268
|
organization_id: organization_id,
|
|
@@ -269,6 +273,7 @@ module StytchB2B
|
|
|
269
273
|
request[:session_duration_minutes] = session_duration_minutes unless session_duration_minutes.nil?
|
|
270
274
|
request[:session_jwt] = session_jwt unless session_jwt.nil?
|
|
271
275
|
request[:session_custom_claims] = session_custom_claims unless session_custom_claims.nil?
|
|
276
|
+
request[:locale] = locale unless locale.nil?
|
|
272
277
|
|
|
273
278
|
post_request('/v1/b2b/passwords/authenticate', request)
|
|
274
279
|
end
|
|
@@ -319,7 +324,7 @@ module StytchB2B
|
|
|
319
324
|
#
|
|
320
325
|
# Request support for additional languages [here](https://docs.google.com/forms/d/e/1FAIpQLScZSpAu_m2AmLXRT3F3kap-s_mcV6UTBitYn6CdyWP0-o7YjQ/viewform?usp=sf_link")!
|
|
321
326
|
#
|
|
322
|
-
# The type of this field is nilable +ResetStartRequestLocale+ (
|
|
327
|
+
# The type of this field is nilable +ResetStartRequestLocale+ (string enum).
|
|
323
328
|
# reset_password_template_id::
|
|
324
329
|
# Use a custom template for reset password emails. By default, it will use your default email template. The template must be a template using our built-in customizations or a custom HTML email for Magic Links - Reset Password.
|
|
325
330
|
# The type of this field is nilable +String+.
|
|
@@ -407,6 +412,9 @@ module StytchB2B
|
|
|
407
412
|
# delete a key, supply a null value. Custom claims made with reserved claims (`iss`, `sub`, `aud`, `exp`, `nbf`, `iat`, `jti`) will be ignored.
|
|
408
413
|
# Total custom claims size cannot exceed four kilobytes.
|
|
409
414
|
# The type of this field is nilable +object+.
|
|
415
|
+
# locale::
|
|
416
|
+
# (no documentation yet)
|
|
417
|
+
# The type of this field is nilable +ResetRequestLocale+ (string enum).
|
|
410
418
|
#
|
|
411
419
|
# == Returns:
|
|
412
420
|
# An object with the following fields:
|
|
@@ -447,7 +455,8 @@ module StytchB2B
|
|
|
447
455
|
session_duration_minutes: nil,
|
|
448
456
|
session_jwt: nil,
|
|
449
457
|
code_verifier: nil,
|
|
450
|
-
session_custom_claims: nil
|
|
458
|
+
session_custom_claims: nil,
|
|
459
|
+
locale: nil
|
|
451
460
|
)
|
|
452
461
|
request = {
|
|
453
462
|
password_reset_token: password_reset_token,
|
|
@@ -458,6 +467,7 @@ module StytchB2B
|
|
|
458
467
|
request[:session_jwt] = session_jwt unless session_jwt.nil?
|
|
459
468
|
request[:code_verifier] = code_verifier unless code_verifier.nil?
|
|
460
469
|
request[:session_custom_claims] = session_custom_claims unless session_custom_claims.nil?
|
|
470
|
+
request[:locale] = locale unless locale.nil?
|
|
461
471
|
|
|
462
472
|
post_request('/v1/b2b/passwords/email/reset', request)
|
|
463
473
|
end
|
|
@@ -575,6 +585,9 @@ module StytchB2B
|
|
|
575
585
|
# delete a key, supply a null value. Custom claims made with reserved claims (`iss`, `sub`, `aud`, `exp`, `nbf`, `iat`, `jti`) will be ignored.
|
|
576
586
|
# Total custom claims size cannot exceed four kilobytes.
|
|
577
587
|
# The type of this field is nilable +object+.
|
|
588
|
+
# locale::
|
|
589
|
+
# (no documentation yet)
|
|
590
|
+
# The type of this field is nilable +ResetRequestLocale+ (string enum).
|
|
578
591
|
#
|
|
579
592
|
# == Returns:
|
|
580
593
|
# An object with the following fields:
|
|
@@ -610,7 +623,8 @@ module StytchB2B
|
|
|
610
623
|
session_token: nil,
|
|
611
624
|
session_duration_minutes: nil,
|
|
612
625
|
session_jwt: nil,
|
|
613
|
-
session_custom_claims: nil
|
|
626
|
+
session_custom_claims: nil,
|
|
627
|
+
locale: nil
|
|
614
628
|
)
|
|
615
629
|
request = {
|
|
616
630
|
email_address: email_address,
|
|
@@ -622,6 +636,7 @@ module StytchB2B
|
|
|
622
636
|
request[:session_duration_minutes] = session_duration_minutes unless session_duration_minutes.nil?
|
|
623
637
|
request[:session_jwt] = session_jwt unless session_jwt.nil?
|
|
624
638
|
request[:session_custom_claims] = session_custom_claims unless session_custom_claims.nil?
|
|
639
|
+
request[:locale] = locale unless locale.nil?
|
|
625
640
|
|
|
626
641
|
post_request('/v1/b2b/passwords/existing_password/reset', request)
|
|
627
642
|
end
|
data/lib/stytch/b2b_sessions.rb
CHANGED
|
@@ -108,7 +108,8 @@ module StytchB2B
|
|
|
108
108
|
session_jwt: nil,
|
|
109
109
|
session_custom_claims: nil
|
|
110
110
|
)
|
|
111
|
-
request = {
|
|
111
|
+
request = {
|
|
112
|
+
}
|
|
112
113
|
request[:session_token] = session_token unless session_token.nil?
|
|
113
114
|
request[:session_duration_minutes] = session_duration_minutes unless session_duration_minutes.nil?
|
|
114
115
|
request[:session_jwt] = session_jwt unless session_jwt.nil?
|
|
@@ -147,7 +148,8 @@ module StytchB2B
|
|
|
147
148
|
session_jwt: nil,
|
|
148
149
|
member_id: nil
|
|
149
150
|
)
|
|
150
|
-
request = {
|
|
151
|
+
request = {
|
|
152
|
+
}
|
|
151
153
|
request[:member_session_id] = member_session_id unless member_session_id.nil?
|
|
152
154
|
request[:session_token] = session_token unless session_token.nil?
|
|
153
155
|
request[:session_jwt] = session_jwt unless session_jwt.nil?
|
|
@@ -188,6 +190,9 @@ module StytchB2B
|
|
|
188
190
|
# delete a key, supply a null value. Custom claims made with reserved claims (`iss`, `sub`, `aud`, `exp`, `nbf`, `iat`, `jti`) will be ignored.
|
|
189
191
|
# Total custom claims size cannot exceed four kilobytes.
|
|
190
192
|
# The type of this field is nilable +object+.
|
|
193
|
+
# locale::
|
|
194
|
+
# (no documentation yet)
|
|
195
|
+
# The type of this field is nilable +ExchangeRequestLocale+ (string enum).
|
|
191
196
|
#
|
|
192
197
|
# == Returns:
|
|
193
198
|
# An object with the following fields:
|
|
@@ -220,7 +225,8 @@ module StytchB2B
|
|
|
220
225
|
session_token: nil,
|
|
221
226
|
session_jwt: nil,
|
|
222
227
|
session_duration_minutes: nil,
|
|
223
|
-
session_custom_claims: nil
|
|
228
|
+
session_custom_claims: nil,
|
|
229
|
+
locale: nil
|
|
224
230
|
)
|
|
225
231
|
request = {
|
|
226
232
|
organization_id: organization_id
|
|
@@ -229,6 +235,7 @@ module StytchB2B
|
|
|
229
235
|
request[:session_jwt] = session_jwt unless session_jwt.nil?
|
|
230
236
|
request[:session_duration_minutes] = session_duration_minutes unless session_duration_minutes.nil?
|
|
231
237
|
request[:session_custom_claims] = session_custom_claims unless session_custom_claims.nil?
|
|
238
|
+
request[:locale] = locale unless locale.nil?
|
|
232
239
|
|
|
233
240
|
post_request('/v1/b2b/sessions/exchange', request)
|
|
234
241
|
end
|
|
@@ -254,7 +261,8 @@ module StytchB2B
|
|
|
254
261
|
def get_jwks(
|
|
255
262
|
project_id:
|
|
256
263
|
)
|
|
257
|
-
query_params = {
|
|
264
|
+
query_params = {
|
|
265
|
+
}
|
|
258
266
|
request = request_with_query_params("/v1/b2b/sessions/jwks/#{project_id}", query_params)
|
|
259
267
|
get_request(request)
|
|
260
268
|
end
|
data/lib/stytch/b2b_sso.rb
CHANGED
|
@@ -44,7 +44,8 @@ module StytchB2B
|
|
|
44
44
|
def get_connections(
|
|
45
45
|
organization_id:
|
|
46
46
|
)
|
|
47
|
-
query_params = {
|
|
47
|
+
query_params = {
|
|
48
|
+
}
|
|
48
49
|
request = request_with_query_params("/v1/b2b/sso/#{organization_id}", query_params)
|
|
49
50
|
get_request(request)
|
|
50
51
|
end
|
|
@@ -114,6 +115,9 @@ module StytchB2B
|
|
|
114
115
|
# delete a key, supply a null value. Custom claims made with reserved claims (`iss`, `sub`, `aud`, `exp`, `nbf`, `iat`, `jti`) will be ignored.
|
|
115
116
|
# Total custom claims size cannot exceed four kilobytes.
|
|
116
117
|
# The type of this field is nilable +object+.
|
|
118
|
+
# locale::
|
|
119
|
+
# (no documentation yet)
|
|
120
|
+
# The type of this field is nilable +AuthenticateRequestLocale+ (string enum).
|
|
117
121
|
#
|
|
118
122
|
# == Returns:
|
|
119
123
|
# An object with the following fields:
|
|
@@ -154,7 +158,8 @@ module StytchB2B
|
|
|
154
158
|
session_token: nil,
|
|
155
159
|
session_jwt: nil,
|
|
156
160
|
session_duration_minutes: nil,
|
|
157
|
-
session_custom_claims: nil
|
|
161
|
+
session_custom_claims: nil,
|
|
162
|
+
locale: nil
|
|
158
163
|
)
|
|
159
164
|
request = {
|
|
160
165
|
sso_token: sso_token
|
|
@@ -164,6 +169,7 @@ module StytchB2B
|
|
|
164
169
|
request[:session_jwt] = session_jwt unless session_jwt.nil?
|
|
165
170
|
request[:session_duration_minutes] = session_duration_minutes unless session_duration_minutes.nil?
|
|
166
171
|
request[:session_custom_claims] = session_custom_claims unless session_custom_claims.nil?
|
|
172
|
+
request[:locale] = locale unless locale.nil?
|
|
167
173
|
|
|
168
174
|
post_request('/v1/b2b/sso/authenticate', request)
|
|
169
175
|
end
|
|
@@ -200,7 +206,8 @@ module StytchB2B
|
|
|
200
206
|
organization_id:,
|
|
201
207
|
display_name: nil
|
|
202
208
|
)
|
|
203
|
-
request = {
|
|
209
|
+
request = {
|
|
210
|
+
}
|
|
204
211
|
request[:display_name] = display_name unless display_name.nil?
|
|
205
212
|
|
|
206
213
|
post_request("/v1/b2b/sso/oidc/#{organization_id}", request)
|
|
@@ -283,7 +290,8 @@ module StytchB2B
|
|
|
283
290
|
userinfo_url: nil,
|
|
284
291
|
jwks_url: nil
|
|
285
292
|
)
|
|
286
|
-
request = {
|
|
293
|
+
request = {
|
|
294
|
+
}
|
|
287
295
|
request[:display_name] = display_name unless display_name.nil?
|
|
288
296
|
request[:client_id] = client_id unless client_id.nil?
|
|
289
297
|
request[:client_secret] = client_secret unless client_secret.nil?
|
|
@@ -329,7 +337,8 @@ module StytchB2B
|
|
|
329
337
|
organization_id:,
|
|
330
338
|
display_name: nil
|
|
331
339
|
)
|
|
332
|
-
request = {
|
|
340
|
+
request = {
|
|
341
|
+
}
|
|
333
342
|
request[:display_name] = display_name unless display_name.nil?
|
|
334
343
|
|
|
335
344
|
post_request("/v1/b2b/sso/saml/#{organization_id}", request)
|
|
@@ -386,7 +395,8 @@ module StytchB2B
|
|
|
386
395
|
x509_certificate: nil,
|
|
387
396
|
idp_sso_url: nil
|
|
388
397
|
)
|
|
389
|
-
request = {
|
|
398
|
+
request = {
|
|
399
|
+
}
|
|
390
400
|
request[:idp_entity_id] = idp_entity_id unless idp_entity_id.nil?
|
|
391
401
|
request[:display_name] = display_name unless display_name.nil?
|
|
392
402
|
request[:attribute_mapping] = attribute_mapping unless attribute_mapping.nil?
|
data/lib/stytch/magic_links.rb
CHANGED
|
@@ -215,7 +215,7 @@ module Stytch
|
|
|
215
215
|
#
|
|
216
216
|
# Request support for additional languages [here](https://docs.google.com/forms/d/e/1FAIpQLScZSpAu_m2AmLXRT3F3kap-s_mcV6UTBitYn6CdyWP0-o7YjQ/viewform?usp=sf_link")!
|
|
217
217
|
#
|
|
218
|
-
# The type of this field is nilable +SendRequestLocale+ (
|
|
218
|
+
# The type of this field is nilable +SendRequestLocale+ (string enum).
|
|
219
219
|
# signup_template_id::
|
|
220
220
|
# Use a custom template for sign-up emails. By default, it will use your default email template. The template must be a template using our built-in customizations or a custom HTML email for Magic links - Sign-up.
|
|
221
221
|
# The type of this field is nilable +String+.
|
|
@@ -315,7 +315,7 @@ module Stytch
|
|
|
315
315
|
#
|
|
316
316
|
# Request support for additional languages [here](https://docs.google.com/forms/d/e/1FAIpQLScZSpAu_m2AmLXRT3F3kap-s_mcV6UTBitYn6CdyWP0-o7YjQ/viewform?usp=sf_link")!
|
|
317
317
|
#
|
|
318
|
-
# The type of this field is nilable +LoginOrCreateRequestLocale+ (
|
|
318
|
+
# The type of this field is nilable +LoginOrCreateRequestLocale+ (string enum).
|
|
319
319
|
#
|
|
320
320
|
# == Returns:
|
|
321
321
|
# An object with the following fields:
|
|
@@ -395,7 +395,7 @@ module Stytch
|
|
|
395
395
|
#
|
|
396
396
|
# Request support for additional languages [here](https://docs.google.com/forms/d/e/1FAIpQLScZSpAu_m2AmLXRT3F3kap-s_mcV6UTBitYn6CdyWP0-o7YjQ/viewform?usp=sf_link")!
|
|
397
397
|
#
|
|
398
|
-
# The type of this field is nilable +InviteRequestLocale+ (
|
|
398
|
+
# The type of this field is nilable +InviteRequestLocale+ (string enum).
|
|
399
399
|
#
|
|
400
400
|
# == Returns:
|
|
401
401
|
# An object with the following fields:
|
data/lib/stytch/otps.rb
CHANGED
|
@@ -153,7 +153,7 @@ module Stytch
|
|
|
153
153
|
#
|
|
154
154
|
# Request support for additional languages [here](https://docs.google.com/forms/d/e/1FAIpQLScZSpAu_m2AmLXRT3F3kap-s_mcV6UTBitYn6CdyWP0-o7YjQ/viewform?usp=sf_link")!
|
|
155
155
|
#
|
|
156
|
-
# The type of this field is nilable +SendRequestLocale+ (
|
|
156
|
+
# The type of this field is nilable +SendRequestLocale+ (string enum).
|
|
157
157
|
# user_id::
|
|
158
158
|
# The unique ID of a specific User.
|
|
159
159
|
# The type of this field is nilable +String+.
|
|
@@ -230,7 +230,7 @@ module Stytch
|
|
|
230
230
|
#
|
|
231
231
|
# Request support for additional languages [here](https://docs.google.com/forms/d/e/1FAIpQLScZSpAu_m2AmLXRT3F3kap-s_mcV6UTBitYn6CdyWP0-o7YjQ/viewform?usp=sf_link")!
|
|
232
232
|
#
|
|
233
|
-
# The type of this field is nilable +LoginOrCreateRequestLocale+ (
|
|
233
|
+
# The type of this field is nilable +LoginOrCreateRequestLocale+ (string enum).
|
|
234
234
|
#
|
|
235
235
|
# == Returns:
|
|
236
236
|
# An object with the following fields:
|
|
@@ -306,7 +306,7 @@ module Stytch
|
|
|
306
306
|
#
|
|
307
307
|
# Request support for additional languages [here](https://docs.google.com/forms/d/e/1FAIpQLScZSpAu_m2AmLXRT3F3kap-s_mcV6UTBitYn6CdyWP0-o7YjQ/viewform?usp=sf_link")!
|
|
308
308
|
#
|
|
309
|
-
# The type of this field is nilable +SendRequestLocale+ (
|
|
309
|
+
# The type of this field is nilable +SendRequestLocale+ (string enum).
|
|
310
310
|
# user_id::
|
|
311
311
|
# The unique ID of a specific User.
|
|
312
312
|
# The type of this field is nilable +String+.
|
|
@@ -383,7 +383,7 @@ module Stytch
|
|
|
383
383
|
#
|
|
384
384
|
# Request support for additional languages [here](https://docs.google.com/forms/d/e/1FAIpQLScZSpAu_m2AmLXRT3F3kap-s_mcV6UTBitYn6CdyWP0-o7YjQ/viewform?usp=sf_link")!
|
|
385
385
|
#
|
|
386
|
-
# The type of this field is nilable +LoginOrCreateRequestLocale+ (
|
|
386
|
+
# The type of this field is nilable +LoginOrCreateRequestLocale+ (string enum).
|
|
387
387
|
#
|
|
388
388
|
# == Returns:
|
|
389
389
|
# An object with the following fields:
|
|
@@ -455,7 +455,7 @@ module Stytch
|
|
|
455
455
|
#
|
|
456
456
|
# Request support for additional languages [here](https://docs.google.com/forms/d/e/1FAIpQLScZSpAu_m2AmLXRT3F3kap-s_mcV6UTBitYn6CdyWP0-o7YjQ/viewform?usp=sf_link")!
|
|
457
457
|
#
|
|
458
|
-
# The type of this field is nilable +SendRequestLocale+ (
|
|
458
|
+
# The type of this field is nilable +SendRequestLocale+ (string enum).
|
|
459
459
|
# user_id::
|
|
460
460
|
# The unique ID of a specific User.
|
|
461
461
|
# The type of this field is nilable +String+.
|
|
@@ -542,7 +542,7 @@ module Stytch
|
|
|
542
542
|
#
|
|
543
543
|
# Request support for additional languages [here](https://docs.google.com/forms/d/e/1FAIpQLScZSpAu_m2AmLXRT3F3kap-s_mcV6UTBitYn6CdyWP0-o7YjQ/viewform?usp=sf_link")!
|
|
544
544
|
#
|
|
545
|
-
# The type of this field is nilable +LoginOrCreateRequestLocale+ (
|
|
545
|
+
# The type of this field is nilable +LoginOrCreateRequestLocale+ (string enum).
|
|
546
546
|
# login_template_id::
|
|
547
547
|
# Use a custom template for login emails. By default, it will use your default email template. The template must be a template using our built-in customizations or a custom HTML email for Magic links - Login.
|
|
548
548
|
# The type of this field is nilable +String+.
|
data/lib/stytch/passwords.rb
CHANGED
|
@@ -265,7 +265,7 @@ module Stytch
|
|
|
265
265
|
# The type of this field is +String+.
|
|
266
266
|
# hash_type::
|
|
267
267
|
# The password hash used. Currently `bcrypt`, `scrypt`, `argon_2i`, `argon_2id`, `md_5`, `sha_1`, and `pbkdf_2` are supported.
|
|
268
|
-
# The type of this field is +MigrateRequestHashType+ (
|
|
268
|
+
# The type of this field is +MigrateRequestHashType+ (string enum).
|
|
269
269
|
# md_5_config::
|
|
270
270
|
# Optional parameters for MD-5 hash types.
|
|
271
271
|
# The type of this field is nilable +MD5Config+ (+object+).
|
|
@@ -383,7 +383,7 @@ module Stytch
|
|
|
383
383
|
#
|
|
384
384
|
# Request support for additional languages [here](https://docs.google.com/forms/d/e/1FAIpQLScZSpAu_m2AmLXRT3F3kap-s_mcV6UTBitYn6CdyWP0-o7YjQ/viewform?usp=sf_link")!
|
|
385
385
|
#
|
|
386
|
-
# The type of this field is nilable +ResetStartRequestLocale+ (
|
|
386
|
+
# The type of this field is nilable +ResetStartRequestLocale+ (string enum).
|
|
387
387
|
# reset_password_template_id::
|
|
388
388
|
# Use a custom template for password reset emails. By default, it will use your default email template.
|
|
389
389
|
# The template must be a template using our built-in customizations or a custom HTML email for Passwords - Password reset.
|
data/lib/stytch/sessions.rb
CHANGED
|
@@ -108,7 +108,8 @@ module Stytch
|
|
|
108
108
|
session_jwt: nil,
|
|
109
109
|
session_custom_claims: nil
|
|
110
110
|
)
|
|
111
|
-
request = {
|
|
111
|
+
request = {
|
|
112
|
+
}
|
|
112
113
|
request[:session_token] = session_token unless session_token.nil?
|
|
113
114
|
request[:session_duration_minutes] = session_duration_minutes unless session_duration_minutes.nil?
|
|
114
115
|
request[:session_jwt] = session_jwt unless session_jwt.nil?
|
|
@@ -143,7 +144,8 @@ module Stytch
|
|
|
143
144
|
session_token: nil,
|
|
144
145
|
session_jwt: nil
|
|
145
146
|
)
|
|
146
|
-
request = {
|
|
147
|
+
request = {
|
|
148
|
+
}
|
|
147
149
|
request[:session_id] = session_id unless session_id.nil?
|
|
148
150
|
request[:session_token] = session_token unless session_token.nil?
|
|
149
151
|
request[:session_jwt] = session_jwt unless session_jwt.nil?
|
|
@@ -172,7 +174,8 @@ module Stytch
|
|
|
172
174
|
def get_jwks(
|
|
173
175
|
project_id:
|
|
174
176
|
)
|
|
175
|
-
query_params = {
|
|
177
|
+
query_params = {
|
|
178
|
+
}
|
|
176
179
|
request = request_with_query_params("/v1/sessions/jwks/#{project_id}", query_params)
|
|
177
180
|
get_request(request)
|
|
178
181
|
end
|
data/lib/stytch/users.rb
CHANGED
|
@@ -77,7 +77,8 @@ module Stytch
|
|
|
77
77
|
trusted_metadata: nil,
|
|
78
78
|
untrusted_metadata: nil
|
|
79
79
|
)
|
|
80
|
-
request = {
|
|
80
|
+
request = {
|
|
81
|
+
}
|
|
81
82
|
request[:email] = email unless email.nil?
|
|
82
83
|
request[:name] = name unless name.nil?
|
|
83
84
|
request[:attributes] = attributes unless attributes.nil?
|
|
@@ -149,7 +150,8 @@ module Stytch
|
|
|
149
150
|
def get(
|
|
150
151
|
user_id:
|
|
151
152
|
)
|
|
152
|
-
query_params = {
|
|
153
|
+
query_params = {
|
|
154
|
+
}
|
|
153
155
|
request = request_with_query_params("/v1/users/#{user_id}", query_params)
|
|
154
156
|
get_request(request)
|
|
155
157
|
end
|
|
@@ -186,7 +188,8 @@ module Stytch
|
|
|
186
188
|
limit: nil,
|
|
187
189
|
query: nil
|
|
188
190
|
)
|
|
189
|
-
request = {
|
|
191
|
+
request = {
|
|
192
|
+
}
|
|
190
193
|
request[:cursor] = cursor unless cursor.nil?
|
|
191
194
|
request[:limit] = limit unless limit.nil?
|
|
192
195
|
request[:query] = query unless query.nil?
|
|
@@ -245,7 +248,8 @@ module Stytch
|
|
|
245
248
|
trusted_metadata: nil,
|
|
246
249
|
untrusted_metadata: nil
|
|
247
250
|
)
|
|
248
|
-
request = {
|
|
251
|
+
request = {
|
|
252
|
+
}
|
|
249
253
|
request[:name] = name unless name.nil?
|
|
250
254
|
request[:attributes] = attributes unless attributes.nil?
|
|
251
255
|
request[:trusted_metadata] = trusted_metadata unless trusted_metadata.nil?
|
data/lib/stytch/version.rb
CHANGED
data/lib/stytch.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: stytch
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 6.
|
|
4
|
+
version: 6.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- stytch
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2023-07-
|
|
11
|
+
date: 2023-07-24 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|
|
@@ -97,7 +97,9 @@ files:
|
|
|
97
97
|
- lib/stytch/b2b_client.rb
|
|
98
98
|
- lib/stytch/b2b_discovery.rb
|
|
99
99
|
- lib/stytch/b2b_magic_links.rb
|
|
100
|
+
- lib/stytch/b2b_oauth.rb
|
|
100
101
|
- lib/stytch/b2b_organizations.rb
|
|
102
|
+
- lib/stytch/b2b_otp.rb
|
|
101
103
|
- lib/stytch/b2b_passwords.rb
|
|
102
104
|
- lib/stytch/b2b_sessions.rb
|
|
103
105
|
- lib/stytch/b2b_sso.rb
|