stytch 10.18.0 → 10.20.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_discovery.rb +23 -22
- data/lib/stytch/b2b_magic_links.rb +3 -0
- data/lib/stytch/b2b_organizations.rb +292 -2
- data/lib/stytch/b2b_otp.rb +6 -3
- data/lib/stytch/b2b_passwords.rb +17 -8
- data/lib/stytch/b2b_sessions.rb +21 -16
- data/lib/stytch/b2b_sso.rb +3 -0
- data/lib/stytch/crypto_wallets.rb +2 -2
- data/lib/stytch/fraud.rb +1 -1
- data/lib/stytch/impersonation.rb +1 -1
- data/lib/stytch/magic_links.rb +19 -9
- data/lib/stytch/oauth.rb +2 -2
- data/lib/stytch/otps.rb +11 -11
- data/lib/stytch/passwords.rb +13 -13
- data/lib/stytch/sessions.rb +12 -10
- data/lib/stytch/totps.rb +6 -6
- data/lib/stytch/users.rb +76 -7
- data/lib/stytch/version.rb +1 -1
- data/lib/stytch/webauthn.rb +6 -6
- metadata +2 -2
data/lib/stytch/b2b_sessions.rb
CHANGED
@@ -231,15 +231,18 @@ module StytchB2B
|
|
231
231
|
|
232
232
|
# Use this endpoint to exchange a's existing session for another session in a different. This can be used to accept an invite, but not to create a new member via domain matching.
|
233
233
|
#
|
234
|
-
# To create a new member via domain
|
234
|
+
# To create a new member via email domain, use the [Exchange Intermediate Session](https://stytch.com/docs/b2b/api/exchange-intermediate-session) flow instead.
|
235
235
|
#
|
236
|
-
#
|
237
|
-
#
|
238
|
-
#
|
239
|
-
#
|
236
|
+
# If the user **has** already satisfied the authentication requirements of the Organization they are trying to switch into, this API will return `member_authenticated: true` and a `session_token` and `session_jwt`.
|
237
|
+
#
|
238
|
+
# If the user **has not** satisfied the primary or secondary authentication requirements of the Organization they are attempting to switch into, this API will return `member_authenticated: false` and an `intermediate_session_token`.
|
239
|
+
#
|
240
|
+
# If `primary_required` is set, prompt the user to fulfill the Organization's auth requirements using the options returned in `primary_required.allowed_auth_methods`.
|
241
|
+
#
|
242
|
+
# If `primary_required` is null and `mfa_required` is set, check `mfa_required.member_options` to determine if the Member has SMS OTP or TOTP set up for MFA and prompt accordingly. If the Member has SMS OTP, check `mfa_required.secondary_auth_initiated` to see if the OTP has already been sent.
|
243
|
+
#
|
244
|
+
# Include the `intermediate_session_token` returned above when calling the `authenticate()` method that the user needed to perform. Once the user has completed the authentication requirements they were missing, they will be granted a full `session_token` and `session_jwt` to indicate they have successfully logged into the Organization.
|
240
245
|
#
|
241
|
-
# If the Member is required to complete MFA to log in to the Organization, the returned value of `member_authenticated` will be `false`, and an `intermediate_session_token` will be returned.
|
242
|
-
# The `intermediate_session_token` can be passed into the [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms) to complete the MFA step and acquire a full member session.
|
243
246
|
# The `intermediate_session_token` can also be used with the [Exchange Intermediate Session endpoint](https://stytch.com/docs/b2b/api/exchange-intermediate-session) or the [Create Organization via Discovery endpoint](https://stytch.com/docs/b2b/api/create-organization-via-discovery) to join a different Organization or create a new one.
|
244
247
|
# The `session_duration_minutes` and `session_custom_claims` parameters will be ignored.
|
245
248
|
#
|
@@ -290,9 +293,6 @@ module StytchB2B
|
|
290
293
|
# member_id::
|
291
294
|
# Globally unique UUID that identifies a specific Member.
|
292
295
|
# The type of this field is +String+.
|
293
|
-
# member_session::
|
294
|
-
# The [Session object](https://stytch.com/docs/b2b/api/session-object).
|
295
|
-
# The type of this field is +MemberSession+ (+object+).
|
296
296
|
# session_token::
|
297
297
|
# A secret token for a given Stytch Session.
|
298
298
|
# The type of this field is +String+.
|
@@ -314,11 +314,14 @@ module StytchB2B
|
|
314
314
|
# status_code::
|
315
315
|
# 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.
|
316
316
|
# The type of this field is +Integer+.
|
317
|
+
# member_session::
|
318
|
+
# The [Session object](https://stytch.com/docs/b2b/api/session-object).
|
319
|
+
# The type of this field is nilable +MemberSession+ (+object+).
|
317
320
|
# mfa_required::
|
318
321
|
# Information about the MFA requirements of the Organization and the Member's options for fulfilling MFA.
|
319
322
|
# The type of this field is nilable +MfaRequired+ (+object+).
|
320
323
|
# primary_required::
|
321
|
-
#
|
324
|
+
# Information about the primary authentication requirements of the Organization.
|
322
325
|
# The type of this field is nilable +PrimaryRequired+ (+object+).
|
323
326
|
def exchange(
|
324
327
|
organization_id:,
|
@@ -344,7 +347,9 @@ module StytchB2B
|
|
344
347
|
# Use this endpoint to exchange a Connected Apps Access Token back into a Member Session for the underlying Member.
|
345
348
|
# This session can be used with the Stytch SDKs and APIs.
|
346
349
|
#
|
347
|
-
# The Access Token must contain the `full_access` scope and must not be more than 5 minutes old. Access Tokens may only be exchanged a single time.
|
350
|
+
# The Access Token must contain the `full_access` scope (only available to First Party clients) and must not be more than 5 minutes old. Access Tokens may only be exchanged a single time.
|
351
|
+
#
|
352
|
+
# The Member Session returned will be the same Member Session that was active in your application (the authorizing party) during the initial authorization flow.
|
348
353
|
#
|
349
354
|
# Because the Member previously completed MFA and satisfied all Organization authentication requirements at the time of the original Access Token issuance, this endpoint will never return an `intermediate_session_token` or require MFA.
|
350
355
|
#
|
@@ -485,13 +490,13 @@ module StytchB2B
|
|
485
490
|
|
486
491
|
# Get the JSON Web Key Set (JWKS) for a project.
|
487
492
|
#
|
488
|
-
# JWKS are rotated every ~6 months. Upon rotation, new JWTs will be signed using the new key, and both keys will be returned by this endpoint for a period of 1 month.
|
493
|
+
# Within the JWKS, the JSON Web Keys are rotated every ~6 months. Upon rotation, new JWTs will be signed using the new key, and both keys will be returned by this endpoint for a period of 1 month.
|
489
494
|
#
|
490
|
-
# JWTs have a set lifetime of 5 minutes, so there will be a 5 minute period where some JWTs will be signed by the old
|
495
|
+
# JWTs have a set lifetime of 5 minutes, so there will be a 5 minute period where some JWTs will be signed by the old keys, and some JWTs will be signed by the new keys. The correct key to use for validation is determined by matching the `kid` value of the JWT and key.
|
491
496
|
#
|
492
|
-
# If you're using one of our [backend SDKs](https://stytch.com/docs/b2b/sdks), the
|
497
|
+
# If you're using one of our [backend SDKs](https://stytch.com/docs/b2b/sdks), the JSON Web Key (JWK) rotation will be handled for you.
|
493
498
|
#
|
494
|
-
# If you're using your own JWT validation library, many have built-in support for
|
499
|
+
# If you're using your own JWT validation library, many have built-in support for JWK rotation, and you'll just need to supply this API endpoint. If not, your application should decide which JWK to use for validation by inspecting the `kid` value.
|
495
500
|
#
|
496
501
|
# See our [How to use Stytch Session JWTs](https://stytch.com/docs/b2b/guides/sessions/resources/using-jwts) guide for more information.
|
497
502
|
#
|
data/lib/stytch/b2b_sso.rb
CHANGED
@@ -230,6 +230,9 @@ module StytchB2B
|
|
230
230
|
# mfa_required::
|
231
231
|
# Information about the MFA requirements of the Organization and the Member's options for fulfilling MFA.
|
232
232
|
# The type of this field is nilable +MfaRequired+ (+object+).
|
233
|
+
# primary_required::
|
234
|
+
# (no documentation yet)
|
235
|
+
# The type of this field is nilable +PrimaryRequired+ (+object+).
|
233
236
|
def authenticate(
|
234
237
|
sso_token:,
|
235
238
|
pkce_code_verifier: nil,
|
@@ -31,7 +31,7 @@ module Stytch
|
|
31
31
|
# The crypto wallet address to authenticate.
|
32
32
|
# The type of this field is +String+.
|
33
33
|
# user_id::
|
34
|
-
# The unique ID of a specific User. You may use an external_id here if one is set for the user.
|
34
|
+
# The unique ID of a specific User. You may use an `external_id` here if one is set for the user.
|
35
35
|
# The type of this field is nilable +String+.
|
36
36
|
# session_token::
|
37
37
|
# The `session_token` associated with a User's existing Session.
|
@@ -139,7 +139,7 @@ module Stytch
|
|
139
139
|
# session::
|
140
140
|
# If you initiate a Session, by including `session_duration_minutes` in your authenticate call, you'll receive a full Session object in the response.
|
141
141
|
#
|
142
|
-
# See [
|
142
|
+
# See [Session object](https://stytch.com/docs/api/session-object) for complete response fields.
|
143
143
|
#
|
144
144
|
# The type of this field is nilable +Session+ (+object+).
|
145
145
|
# siwe_params::
|
data/lib/stytch/fraud.rb
CHANGED
@@ -27,7 +27,7 @@ module Stytch
|
|
27
27
|
@connection = connection
|
28
28
|
end
|
29
29
|
|
30
|
-
# Lookup the associated fingerprint for the `telemetry_id` returned from the `GetTelemetryID` function. Learn more about the different fingerprint types and verdicts in our [DFP guide](https://stytch.com/docs/fraud/guides/device-fingerprinting/overview).
|
30
|
+
# Lookup the associated fingerprint for the `telemetry_id` returned from the `GetTelemetryID()` function. Learn more about the different fingerprint types and verdicts in our [DFP guide](https://stytch.com/docs/fraud/guides/device-fingerprinting/overview).
|
31
31
|
#
|
32
32
|
# Make a decision based on the returned `verdict`:
|
33
33
|
# * `ALLOW` - This is a known valid device grouping or device profile that is part of the default `ALLOW` listed set of known devices by Stytch. This grouping is made up of verified device profiles that match the characteristics of known/authentic traffic origins.
|
data/lib/stytch/impersonation.rb
CHANGED
@@ -49,7 +49,7 @@ module Stytch
|
|
49
49
|
# session::
|
50
50
|
# If you initiate a Session, by including `session_duration_minutes` in your authenticate call, you'll receive a full Session object in the response.
|
51
51
|
#
|
52
|
-
# See [
|
52
|
+
# See [Session object](https://stytch.com/docs/api/session-object) for complete response fields.
|
53
53
|
#
|
54
54
|
# The type of this field is nilable +Session+ (+object+).
|
55
55
|
def authenticate(
|
data/lib/stytch/magic_links.rb
CHANGED
@@ -30,7 +30,7 @@ module Stytch
|
|
30
30
|
# In the redirect URL, the `stytch_token_type` will be `magic_link`. See [here](https://stytch.com/docs/workspace-management/redirect-urls) for more detail.
|
31
31
|
# The type of this field is +String+.
|
32
32
|
# attributes::
|
33
|
-
# Provided attributes help with fraud detection.
|
33
|
+
# Provided attributes to help with fraud detection. These values are pulled and passed into Stytch endpoints by your application.
|
34
34
|
# The type of this field is nilable +Attributes+ (+object+).
|
35
35
|
# options::
|
36
36
|
# Specify optional security settings.
|
@@ -90,7 +90,7 @@ module Stytch
|
|
90
90
|
# session::
|
91
91
|
# If you initiate a Session, by including `session_duration_minutes` in your authenticate call, you'll receive a full Session object in the response.
|
92
92
|
#
|
93
|
-
# See [
|
93
|
+
# See [Session object](https://stytch.com/docs/api/session-object) for complete response fields.
|
94
94
|
#
|
95
95
|
# The type of this field is nilable +Session+ (+object+).
|
96
96
|
def authenticate(
|
@@ -127,13 +127,13 @@ module Stytch
|
|
127
127
|
#
|
128
128
|
# == Parameters:
|
129
129
|
# user_id::
|
130
|
-
# The unique ID of a specific User. You may use an external_id here if one is set for the user.
|
130
|
+
# The unique ID of a specific User. You may use an `external_id` here if one is set for the user.
|
131
131
|
# The type of this field is +String+.
|
132
132
|
# expiration_minutes::
|
133
133
|
# Set the expiration for the Magic Link `token` in minutes. By default, it expires in 1 hour. The minimum expiration is 5 minutes and the maximum is 7 days (10080 mins).
|
134
134
|
# The type of this field is nilable +Integer+.
|
135
135
|
# attributes::
|
136
|
-
# Provided attributes help with fraud detection.
|
136
|
+
# Provided attributes to help with fraud detection. These values are pulled and passed into Stytch endpoints by your application.
|
137
137
|
# The type of this field is nilable +Attributes+ (+object+).
|
138
138
|
#
|
139
139
|
# == Returns:
|
@@ -188,7 +188,7 @@ module Stytch
|
|
188
188
|
# 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.
|
189
189
|
# The type of this field is nilable +String+.
|
190
190
|
# attributes::
|
191
|
-
# Provided attributes help with fraud detection.
|
191
|
+
# Provided attributes to help with fraud detection. These values are pulled and passed into Stytch endpoints by your application.
|
192
192
|
# The type of this field is nilable +Attributes+ (+object+).
|
193
193
|
# login_magic_link_url::
|
194
194
|
# The URL the end user clicks from the login Email Magic Link. This should be a URL that your app receives and parses and subsequently send an API request to authenticate the Magic Link and log in the User. If this value is not passed, the default login redirect URL that you set in your Dashboard is used. If you have not set a default login redirect URL, an error is returned.
|
@@ -206,7 +206,7 @@ module Stytch
|
|
206
206
|
# A base64url encoded SHA256 hash of a one time secret used to validate that the request starts and ends on the same device.
|
207
207
|
# The type of this field is nilable +String+.
|
208
208
|
# user_id::
|
209
|
-
# The unique ID of a specific User. You may use an external_id here if one is set for the user.
|
209
|
+
# The unique ID of a specific User. You may use an `external_id` here if one is set for the user.
|
210
210
|
# The type of this field is nilable +String+.
|
211
211
|
# session_token::
|
212
212
|
# The `session_token` of the user to associate the email with.
|
@@ -303,7 +303,7 @@ module Stytch
|
|
303
303
|
# 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.
|
304
304
|
# The type of this field is nilable +String+.
|
305
305
|
# attributes::
|
306
|
-
# Provided attributes help with fraud detection.
|
306
|
+
# Provided attributes to help with fraud detection. These values are pulled and passed into Stytch endpoints by your application.
|
307
307
|
# The type of this field is nilable +Attributes+ (+object+).
|
308
308
|
# create_user_as_pending::
|
309
309
|
# Flag for whether or not to save a user as pending vs active in Stytch. Defaults to false.
|
@@ -385,7 +385,7 @@ module Stytch
|
|
385
385
|
# Use a custom template for invite 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 - Invite.
|
386
386
|
# The type of this field is nilable +String+.
|
387
387
|
# attributes::
|
388
|
-
# Provided attributes help with fraud detection.
|
388
|
+
# Provided attributes to help with fraud detection. These values are pulled and passed into Stytch endpoints by your application.
|
389
389
|
# The type of this field is nilable +Attributes+ (+object+).
|
390
390
|
# name::
|
391
391
|
# The name of the user. Each field in the name object is optional.
|
@@ -404,6 +404,12 @@ module Stytch
|
|
404
404
|
# Request support for additional languages [here](https://docs.google.com/forms/d/e/1FAIpQLScZSpAu_m2AmLXRT3F3kap-s_mcV6UTBitYn6CdyWP0-o7YjQ/viewform?usp=sf_link")!
|
405
405
|
#
|
406
406
|
# The type of this field is nilable +InviteRequestLocale+ (string enum).
|
407
|
+
# trusted_metadata::
|
408
|
+
# The `trusted_metadata` field contains an arbitrary JSON object of application-specific data. See the [Metadata](https://stytch.com/docs/api/metadata) reference for complete field behavior details.
|
409
|
+
# The type of this field is nilable +object+.
|
410
|
+
# untrusted_metadata::
|
411
|
+
# The `untrusted_metadata` field contains an arbitrary JSON object of application-specific data. Untrusted metadata can be edited by end users directly via the SDK, and **cannot be used to store critical information.** See the [Metadata](https://stytch.com/docs/api/metadata) reference for complete field behavior details.
|
412
|
+
# The type of this field is nilable +object+.
|
407
413
|
#
|
408
414
|
# == Returns:
|
409
415
|
# An object with the following fields:
|
@@ -426,7 +432,9 @@ module Stytch
|
|
426
432
|
name: nil,
|
427
433
|
invite_magic_link_url: nil,
|
428
434
|
invite_expiration_minutes: nil,
|
429
|
-
locale: nil
|
435
|
+
locale: nil,
|
436
|
+
trusted_metadata: nil,
|
437
|
+
untrusted_metadata: nil
|
430
438
|
)
|
431
439
|
headers = {}
|
432
440
|
request = {
|
@@ -438,6 +446,8 @@ module Stytch
|
|
438
446
|
request[:invite_magic_link_url] = invite_magic_link_url unless invite_magic_link_url.nil?
|
439
447
|
request[:invite_expiration_minutes] = invite_expiration_minutes unless invite_expiration_minutes.nil?
|
440
448
|
request[:locale] = locale unless locale.nil?
|
449
|
+
request[:trusted_metadata] = trusted_metadata unless trusted_metadata.nil?
|
450
|
+
request[:untrusted_metadata] = untrusted_metadata unless untrusted_metadata.nil?
|
441
451
|
|
442
452
|
post_request('/v1/magic_links/email/invite', request, headers)
|
443
453
|
end
|
data/lib/stytch/oauth.rb
CHANGED
@@ -29,7 +29,7 @@ module Stytch
|
|
29
29
|
# The OAuth provider's name.
|
30
30
|
# The type of this field is +String+.
|
31
31
|
# user_id::
|
32
|
-
# The unique ID of a specific User. You may use an external_id here if one is set for the user.
|
32
|
+
# The unique ID of a specific User. You may use an `external_id` here if one is set for the user.
|
33
33
|
# The type of this field is nilable +String+.
|
34
34
|
# session_token::
|
35
35
|
# The `session_token` associated with a User's existing Session.
|
@@ -142,7 +142,7 @@ module Stytch
|
|
142
142
|
# user_session::
|
143
143
|
# A `Session` object. For backwards compatibility reasons, the session from an OAuth authenticate call is labeled as `user_session`, but is otherwise just a standard stytch `Session` object.
|
144
144
|
#
|
145
|
-
# See [
|
145
|
+
# See [Session object](https://stytch.com/docs/api/session-object) for complete response fields.
|
146
146
|
#
|
147
147
|
# The type of this field is nilable +Session+ (+object+).
|
148
148
|
def authenticate(
|
data/lib/stytch/otps.rb
CHANGED
@@ -31,7 +31,7 @@ module Stytch
|
|
31
31
|
# The code to authenticate.
|
32
32
|
# The type of this field is +String+.
|
33
33
|
# attributes::
|
34
|
-
# Provided attributes help with fraud detection.
|
34
|
+
# Provided attributes to help with fraud detection. These values are pulled and passed into Stytch endpoints by your application.
|
35
35
|
# The type of this field is nilable +Attributes+ (+object+).
|
36
36
|
# options::
|
37
37
|
# Specify optional security settings.
|
@@ -88,7 +88,7 @@ module Stytch
|
|
88
88
|
# session::
|
89
89
|
# If you initiate a Session, by including `session_duration_minutes` in your authenticate call, you'll receive a full Session object in the response.
|
90
90
|
#
|
91
|
-
# See [
|
91
|
+
# See [Session object](https://stytch.com/docs/api/session-object) for complete response fields.
|
92
92
|
#
|
93
93
|
# The type of this field is nilable +Session+ (+object+).
|
94
94
|
def authenticate(
|
@@ -150,7 +150,7 @@ module Stytch
|
|
150
150
|
# Set the expiration for the one-time passcode, in minutes. The minimum expiration is 1 minute and the maximum is 10 minutes. The default expiration is 2 minutes.
|
151
151
|
# The type of this field is nilable +Integer+.
|
152
152
|
# attributes::
|
153
|
-
# Provided attributes help with fraud detection.
|
153
|
+
# Provided attributes to help with fraud detection. These values are pulled and passed into Stytch endpoints by your application.
|
154
154
|
# The type of this field is nilable +Attributes+ (+object+).
|
155
155
|
# locale::
|
156
156
|
# Used to determine which language to use when sending the user this delivery method. Parameter is a [IETF BCP 47 language tag](https://www.w3.org/International/articles/language-tags/), e.g. `"en"`.
|
@@ -161,7 +161,7 @@ module Stytch
|
|
161
161
|
#
|
162
162
|
# The type of this field is nilable +SendRequestLocale+ (string enum).
|
163
163
|
# user_id::
|
164
|
-
# The unique ID of a specific User. You may use an external_id here if one is set for the user.
|
164
|
+
# The unique ID of a specific User. You may use an `external_id` here if one is set for the user.
|
165
165
|
# The type of this field is nilable +String+.
|
166
166
|
# session_token::
|
167
167
|
# The `session_token` associated with a User's existing Session.
|
@@ -228,7 +228,7 @@ module Stytch
|
|
228
228
|
# Set the expiration for the one-time passcode, in minutes. The minimum expiration is 1 minute and the maximum is 10 minutes. The default expiration is 2 minutes.
|
229
229
|
# The type of this field is nilable +Integer+.
|
230
230
|
# attributes::
|
231
|
-
# Provided attributes help with fraud detection.
|
231
|
+
# Provided attributes to help with fraud detection. These values are pulled and passed into Stytch endpoints by your application.
|
232
232
|
# The type of this field is nilable +Attributes+ (+object+).
|
233
233
|
# create_user_as_pending::
|
234
234
|
# Flag for whether or not to save a user as pending vs active in Stytch. Defaults to false.
|
@@ -313,7 +313,7 @@ module Stytch
|
|
313
313
|
# Set the expiration for the one-time passcode, in minutes. The minimum expiration is 1 minute and the maximum is 10 minutes. The default expiration is 2 minutes.
|
314
314
|
# The type of this field is nilable +Integer+.
|
315
315
|
# attributes::
|
316
|
-
# Provided attributes help with fraud detection.
|
316
|
+
# Provided attributes to help with fraud detection. These values are pulled and passed into Stytch endpoints by your application.
|
317
317
|
# The type of this field is nilable +Attributes+ (+object+).
|
318
318
|
# locale::
|
319
319
|
# Used to determine which language to use when sending the user this delivery method. Parameter is a [IETF BCP 47 language tag](https://www.w3.org/International/articles/language-tags/), e.g. `"en"`.
|
@@ -324,7 +324,7 @@ module Stytch
|
|
324
324
|
#
|
325
325
|
# The type of this field is nilable +SendRequestLocale+ (string enum).
|
326
326
|
# user_id::
|
327
|
-
# The unique ID of a specific User. You may use an external_id here if one is set for the user.
|
327
|
+
# The unique ID of a specific User. You may use an `external_id` here if one is set for the user.
|
328
328
|
# The type of this field is nilable +String+.
|
329
329
|
# session_token::
|
330
330
|
# The `session_token` associated with a User's existing Session.
|
@@ -387,7 +387,7 @@ module Stytch
|
|
387
387
|
# Set the expiration for the one-time passcode, in minutes. The minimum expiration is 1 minute and the maximum is 10 minutes. The default expiration is 2 minutes.
|
388
388
|
# The type of this field is nilable +Integer+.
|
389
389
|
# attributes::
|
390
|
-
# Provided attributes help with fraud detection.
|
390
|
+
# Provided attributes to help with fraud detection. These values are pulled and passed into Stytch endpoints by your application.
|
391
391
|
# The type of this field is nilable +Attributes+ (+object+).
|
392
392
|
# create_user_as_pending::
|
393
393
|
# Flag for whether or not to save a user as pending vs active in Stytch. Defaults to false.
|
@@ -465,7 +465,7 @@ module Stytch
|
|
465
465
|
# Set the expiration for the one-time passcode, in minutes. The minimum expiration is 1 minute and the maximum is 10 minutes. The default expiration is 2 minutes.
|
466
466
|
# The type of this field is nilable +Integer+.
|
467
467
|
# attributes::
|
468
|
-
# Provided attributes help with fraud detection.
|
468
|
+
# Provided attributes to help with fraud detection. These values are pulled and passed into Stytch endpoints by your application.
|
469
469
|
# The type of this field is nilable +Attributes+ (+object+).
|
470
470
|
# locale::
|
471
471
|
# Used to determine which language to use when sending the user this delivery method. Parameter is a [IETF BCP 47 language tag](https://www.w3.org/International/articles/language-tags/), e.g. `"en"`.
|
@@ -476,7 +476,7 @@ module Stytch
|
|
476
476
|
#
|
477
477
|
# The type of this field is nilable +SendRequestLocale+ (string enum).
|
478
478
|
# user_id::
|
479
|
-
# The unique ID of a specific User. You may use an external_id here if one is set for the user.
|
479
|
+
# The unique ID of a specific User. You may use an `external_id` here if one is set for the user.
|
480
480
|
# The type of this field is nilable +String+.
|
481
481
|
# session_token::
|
482
482
|
# The `session_token` associated with a User's existing Session.
|
@@ -546,7 +546,7 @@ module Stytch
|
|
546
546
|
# Set the expiration for the one-time passcode, in minutes. The minimum expiration is 1 minute and the maximum is 10 minutes. The default expiration is 2 minutes.
|
547
547
|
# The type of this field is nilable +Integer+.
|
548
548
|
# attributes::
|
549
|
-
# Provided attributes help with fraud detection.
|
549
|
+
# Provided attributes to help with fraud detection. These values are pulled and passed into Stytch endpoints by your application.
|
550
550
|
# The type of this field is nilable +Attributes+ (+object+).
|
551
551
|
# create_user_as_pending::
|
552
552
|
# Flag for whether or not to save a user as pending vs active in Stytch. Defaults to false.
|
data/lib/stytch/passwords.rb
CHANGED
@@ -34,7 +34,7 @@ module Stytch
|
|
34
34
|
# The email address of the end user.
|
35
35
|
# The type of this field is +String+.
|
36
36
|
# password::
|
37
|
-
# The password for the user. Any UTF8 character is allowed, e.g. spaces, emojis, non-English
|
37
|
+
# The password for the user. Any UTF8 character is allowed, e.g. spaces, emojis, non-English characters, etc.
|
38
38
|
# The type of this field is +String+.
|
39
39
|
# session_duration_minutes::
|
40
40
|
# Set the session lifetime to be this many minutes from now. This will start a new session if one doesn't already exist,
|
@@ -88,7 +88,7 @@ module Stytch
|
|
88
88
|
# session::
|
89
89
|
# If you initiate a Session, by including `session_duration_minutes` in your authenticate call, you'll receive a full Session object in the response.
|
90
90
|
#
|
91
|
-
# See [
|
91
|
+
# See [Session object](https://stytch.com/docs/api/session-object) for complete response fields.
|
92
92
|
#
|
93
93
|
# The type of this field is nilable +Session+ (+object+).
|
94
94
|
def create(
|
@@ -127,7 +127,7 @@ module Stytch
|
|
127
127
|
# The email address of the end user.
|
128
128
|
# The type of this field is +String+.
|
129
129
|
# password::
|
130
|
-
# The password for the user. Any UTF8 character is allowed, e.g. spaces, emojis, non-English
|
130
|
+
# The password for the user. Any UTF8 character is allowed, e.g. spaces, emojis, non-English characters, etc.
|
131
131
|
# The type of this field is +String+.
|
132
132
|
# session_token::
|
133
133
|
# The `session_token` associated with a User's existing Session.
|
@@ -175,7 +175,7 @@ module Stytch
|
|
175
175
|
# session::
|
176
176
|
# If you initiate a Session, by including `session_duration_minutes` in your authenticate call, you'll receive a full Session object in the response.
|
177
177
|
#
|
178
|
-
# See [
|
178
|
+
# See [Session object](https://stytch.com/docs/api/session-object) for complete response fields.
|
179
179
|
#
|
180
180
|
# The type of this field is nilable +Session+ (+object+).
|
181
181
|
def authenticate(
|
@@ -214,7 +214,7 @@ module Stytch
|
|
214
214
|
#
|
215
215
|
# == Parameters:
|
216
216
|
# password::
|
217
|
-
# The password for the user. Any UTF8 character is allowed, e.g. spaces, emojis, non-English
|
217
|
+
# The password for the user. Any UTF8 character is allowed, e.g. spaces, emojis, non-English characters, etc.
|
218
218
|
# The type of this field is +String+.
|
219
219
|
# email::
|
220
220
|
# The email address of the end user.
|
@@ -308,7 +308,7 @@ module Stytch
|
|
308
308
|
# the user owns the phone number in question. Access to this field is restricted. To enable it, please send us a note at support@stytch.com.
|
309
309
|
# The type of this field is nilable +Boolean+.
|
310
310
|
# external_id::
|
311
|
-
# If a new user is created, this will set an identifier that can be used in API calls wherever a user_id is expected. This is a string consisting of alphanumeric, `.`, `_`, `-`, or `|` characters with a maximum length of 128 characters.
|
311
|
+
# If a new user is created, this will set an identifier that can be used in API calls wherever a user_id is expected. This is a string consisting of alphanumeric, `.`, `_`, `-`, or `|` characters with a maximum length of 128 characters.
|
312
312
|
# The type of this field is nilable +String+.
|
313
313
|
#
|
314
314
|
# == Returns:
|
@@ -398,7 +398,7 @@ module Stytch
|
|
398
398
|
# A base64url encoded SHA256 hash of a one time secret used to validate that the request starts and ends on the same device.
|
399
399
|
# The type of this field is nilable +String+.
|
400
400
|
# attributes::
|
401
|
-
# Provided attributes help with fraud detection.
|
401
|
+
# Provided attributes to help with fraud detection. These values are pulled and passed into Stytch endpoints by your application.
|
402
402
|
# The type of this field is nilable +Attributes+ (+object+).
|
403
403
|
# login_redirect_url::
|
404
404
|
# The URL Stytch redirects to after the OAuth flow is completed for a user that already exists. This URL should be a route in your application which will run `oauth.authenticate` (see below) and finish the login.
|
@@ -472,7 +472,7 @@ module Stytch
|
|
472
472
|
# See examples and read more about redirect URLs [here](https://stytch.com/docs/workspace-management/redirect-urls).
|
473
473
|
# The type of this field is +String+.
|
474
474
|
# password::
|
475
|
-
# The password for the user. Any UTF8 character is allowed, e.g. spaces, emojis, non-English
|
475
|
+
# The password for the user. Any UTF8 character is allowed, e.g. spaces, emojis, non-English characters, etc.
|
476
476
|
# The type of this field is +String+.
|
477
477
|
# session_token::
|
478
478
|
# The `session_token` associated with a User's existing Session.
|
@@ -500,7 +500,7 @@ module Stytch
|
|
500
500
|
# Custom claims made with reserved claims ("iss", "sub", "aud", "exp", "nbf", "iat", "jti") will be ignored. Total custom claims size cannot exceed four kilobytes.
|
501
501
|
# The type of this field is nilable +object+.
|
502
502
|
# attributes::
|
503
|
-
# Provided attributes help with fraud detection.
|
503
|
+
# Provided attributes to help with fraud detection. These values are pulled and passed into Stytch endpoints by your application.
|
504
504
|
# The type of this field is nilable +Attributes+ (+object+).
|
505
505
|
# options::
|
506
506
|
# Specify optional security settings.
|
@@ -529,7 +529,7 @@ module Stytch
|
|
529
529
|
# session::
|
530
530
|
# If you initiate a Session, by including `session_duration_minutes` in your authenticate call, you'll receive a full Session object in the response.
|
531
531
|
#
|
532
|
-
# See [
|
532
|
+
# See [Session object](https://stytch.com/docs/api/session-object) for complete response fields.
|
533
533
|
#
|
534
534
|
# The type of this field is nilable +Session+ (+object+).
|
535
535
|
def reset(
|
@@ -627,7 +627,7 @@ module Stytch
|
|
627
627
|
# session::
|
628
628
|
# If you initiate a Session, by including `session_duration_minutes` in your authenticate call, you'll receive a full Session object in the response.
|
629
629
|
#
|
630
|
-
# See [
|
630
|
+
# See [Session object](https://stytch.com/docs/api/session-object) for complete response fields.
|
631
631
|
#
|
632
632
|
# The type of this field is nilable +Session+ (+object+).
|
633
633
|
def reset(
|
@@ -667,7 +667,7 @@ module Stytch
|
|
667
667
|
#
|
668
668
|
# == Parameters:
|
669
669
|
# password::
|
670
|
-
# The password for the user. Any UTF8 character is allowed, e.g. spaces, emojis, non-English
|
670
|
+
# The password for the user. Any UTF8 character is allowed, e.g. spaces, emojis, non-English characters, etc.
|
671
671
|
# The type of this field is +String+.
|
672
672
|
# session_token::
|
673
673
|
# The `session_token` associated with a User's existing Session.
|
@@ -715,7 +715,7 @@ module Stytch
|
|
715
715
|
# session::
|
716
716
|
# If you initiate a Session, by including `session_duration_minutes` in your authenticate call, you'll receive a full Session object in the response.
|
717
717
|
#
|
718
|
-
# See [
|
718
|
+
# See [Session object](https://stytch.com/docs/api/session-object) for complete response fields.
|
719
719
|
#
|
720
720
|
# The type of this field is nilable +Session+ (+object+).
|
721
721
|
def reset(
|
data/lib/stytch/sessions.rb
CHANGED
@@ -37,7 +37,7 @@ module Stytch
|
|
37
37
|
#
|
38
38
|
# == Parameters:
|
39
39
|
# user_id::
|
40
|
-
# The `user_id` to get active Sessions for. You may use an external_id here if one is set for the user.
|
40
|
+
# The `user_id` to get active Sessions for. You may use an `external_id` here if one is set for the user.
|
41
41
|
# The type of this field is +String+.
|
42
42
|
#
|
43
43
|
# == Returns:
|
@@ -46,7 +46,7 @@ module Stytch
|
|
46
46
|
# 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.
|
47
47
|
# The type of this field is +String+.
|
48
48
|
# sessions::
|
49
|
-
# An array of Session objects.
|
49
|
+
# An array of [Session objects](https://stytch.com/docs/api/session-object).
|
50
50
|
# The type of this field is list of +Session+ (+object+).
|
51
51
|
# status_code::
|
52
52
|
# 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.
|
@@ -90,7 +90,7 @@ module Stytch
|
|
90
90
|
# session::
|
91
91
|
# If you initiate a Session, by including `session_duration_minutes` in your authenticate call, you'll receive a full Session object in the response.
|
92
92
|
#
|
93
|
-
# See [
|
93
|
+
# See [Session object](https://stytch.com/docs/api/session-object) for complete response fields.
|
94
94
|
#
|
95
95
|
# The type of this field is +Session+ (+object+).
|
96
96
|
# session_token::
|
@@ -202,7 +202,7 @@ module Stytch
|
|
202
202
|
# session::
|
203
203
|
# If you initiate a Session, by including `session_duration_minutes` in your authenticate call, you'll receive a full Session object in the response.
|
204
204
|
#
|
205
|
-
# See [
|
205
|
+
# See [Session object](https://stytch.com/docs/api/session-object) for complete response fields.
|
206
206
|
#
|
207
207
|
# The type of this field is nilable +Session+ (+object+).
|
208
208
|
def migrate(
|
@@ -223,7 +223,9 @@ module Stytch
|
|
223
223
|
# Use this endpoint to exchange a Connected Apps Access Token back into a Stytch Session for the underlying User.
|
224
224
|
# This session can be used with the Stytch SDKs and APIs.
|
225
225
|
#
|
226
|
-
# The
|
226
|
+
# The Session returned will be the same Session that was active in your application (the authorizing party) during the initial authorization flow.
|
227
|
+
#
|
228
|
+
# The Access Token must contain the `full_access` scope (only available to First Party clients) and must not be more than 5 minutes old. Access Tokens may only be exchanged a single time.
|
227
229
|
#
|
228
230
|
# == Parameters:
|
229
231
|
# access_token::
|
@@ -269,7 +271,7 @@ module Stytch
|
|
269
271
|
# session::
|
270
272
|
# If you initiate a Session, by including `session_duration_minutes` in your authenticate call, you'll receive a full Session object in the response.
|
271
273
|
#
|
272
|
-
# See [
|
274
|
+
# See [Session object](https://stytch.com/docs/api/session-object) for complete response fields.
|
273
275
|
#
|
274
276
|
# The type of this field is nilable +Session+ (+object+).
|
275
277
|
def exchange_access_token(
|
@@ -289,13 +291,13 @@ module Stytch
|
|
289
291
|
|
290
292
|
# Get the JSON Web Key Set (JWKS) for a project.
|
291
293
|
#
|
292
|
-
# JWKS are rotated every ~6 months. Upon rotation, new JWTs will be signed using the new key, and both keys will be returned by this endpoint for a period of 1 month.
|
294
|
+
# Within the JWKS, the JSON Web Keys are rotated every ~6 months. Upon rotation, new JWTs will be signed using the new key, and both keys will be returned by this endpoint for a period of 1 month.
|
293
295
|
#
|
294
|
-
# JWTs have a set lifetime of 5 minutes, so there will be a 5 minute period where some JWTs will be signed by the old
|
296
|
+
# JWTs have a set lifetime of 5 minutes, so there will be a 5 minute period where some JWTs will be signed by the old keys, and some JWTs will be signed by the new keys. The correct key to use for validation is determined by matching the `kid` value of the JWT and key.
|
295
297
|
#
|
296
|
-
# If you're using one of our [backend SDKs](https://stytch.com/docs/sdks), the
|
298
|
+
# If you're using one of our [backend SDKs](https://stytch.com/docs/b2b/sdks), the JSON Web Key (JWK) rotation will be handled for you.
|
297
299
|
#
|
298
|
-
# If you're using your own JWT validation library, many have built-in support for
|
300
|
+
# If you're using your own JWT validation library, many have built-in support for JWK rotation, and you'll just need to supply this API endpoint. If not, your application should decide which JWK to use for validation by inspecting the `kid` value.
|
299
301
|
#
|
300
302
|
# See our [How to use Stytch Session JWTs](https://stytch.com/docs/guides/sessions/using-jwts) guide for more information.
|
301
303
|
#
|
data/lib/stytch/totps.rb
CHANGED
@@ -20,7 +20,7 @@ module Stytch
|
|
20
20
|
#
|
21
21
|
# == Parameters:
|
22
22
|
# user_id::
|
23
|
-
# The `user_id` of an active user the TOTP registration should be tied to. You may use an external_id here if one is set for the user.
|
23
|
+
# The `user_id` of an active user the TOTP registration should be tied to. You may use an `external_id` here if one is set for the user.
|
24
24
|
# The type of this field is +String+.
|
25
25
|
# expiration_minutes::
|
26
26
|
# The expiration for the TOTP instance. If the newly created TOTP is not authenticated within this time frame the TOTP will be unusable. Defaults to 1440 (1 day) with a minimum of 5 and a maximum of 1440.
|
@@ -69,7 +69,7 @@ module Stytch
|
|
69
69
|
#
|
70
70
|
# == Parameters:
|
71
71
|
# user_id::
|
72
|
-
# The `user_id` of an active user the TOTP registration should be tied to. You may use an external_id here if one is set for the user.
|
72
|
+
# The `user_id` of an active user the TOTP registration should be tied to. You may use an `external_id` here if one is set for the user.
|
73
73
|
# The type of this field is +String+.
|
74
74
|
# totp_code::
|
75
75
|
# The TOTP code to authenticate. The TOTP code should consist of 6 digits.
|
@@ -123,7 +123,7 @@ module Stytch
|
|
123
123
|
# session::
|
124
124
|
# If you initiate a Session, by including `session_duration_minutes` in your authenticate call, you'll receive a full Session object in the response.
|
125
125
|
#
|
126
|
-
# See [
|
126
|
+
# See [Session object](https://stytch.com/docs/api/session-object) for complete response fields.
|
127
127
|
#
|
128
128
|
# The type of this field is nilable +Session+ (+object+).
|
129
129
|
def authenticate(
|
@@ -151,7 +151,7 @@ module Stytch
|
|
151
151
|
#
|
152
152
|
# == Parameters:
|
153
153
|
# user_id::
|
154
|
-
# The `user_id` of an active user the TOTP registration should be tied to. You may use an external_id here if one is set for the user.
|
154
|
+
# The `user_id` of an active user the TOTP registration should be tied to. You may use an `external_id` here if one is set for the user.
|
155
155
|
# The type of this field is +String+.
|
156
156
|
#
|
157
157
|
# == Returns:
|
@@ -183,7 +183,7 @@ module Stytch
|
|
183
183
|
#
|
184
184
|
# == Parameters:
|
185
185
|
# user_id::
|
186
|
-
# The `user_id` of an active user the TOTP registration should be tied to. You may use an external_id here if one is set for the user.
|
186
|
+
# The `user_id` of an active user the TOTP registration should be tied to. You may use an `external_id` here if one is set for the user.
|
187
187
|
# The type of this field is +String+.
|
188
188
|
# recovery_code::
|
189
189
|
# The recovery code to authenticate.
|
@@ -237,7 +237,7 @@ module Stytch
|
|
237
237
|
# session::
|
238
238
|
# If you initiate a Session, by including `session_duration_minutes` in your authenticate call, you'll receive a full Session object in the response.
|
239
239
|
#
|
240
|
-
# See [
|
240
|
+
# See [Session object](https://stytch.com/docs/api/session-object) for complete response fields.
|
241
241
|
#
|
242
242
|
# The type of this field is nilable +Session+ (+object+).
|
243
243
|
def recover(
|