stytch 10.27.0 → 10.29.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 +2 -2
- data/lib/stytch/b2b_discovery.rb +18 -2
- data/lib/stytch/b2b_idp.rb +272 -32
- data/lib/stytch/b2b_magic_links.rb +9 -1
- data/lib/stytch/b2b_oauth.rb +9 -1
- data/lib/stytch/b2b_organizations.rb +9 -3
- data/lib/stytch/b2b_otp.rb +18 -2
- data/lib/stytch/b2b_passwords.rb +36 -4
- data/lib/stytch/b2b_recovery_codes.rb +9 -1
- data/lib/stytch/b2b_sessions.rb +32 -8
- data/lib/stytch/b2b_sso.rb +9 -1
- data/lib/stytch/b2b_totps.rb +9 -1
- data/lib/stytch/client.rb +2 -2
- data/lib/stytch/crypto_wallets.rb +9 -1
- data/lib/stytch/idp.rb +258 -32
- data/lib/stytch/magic_links.rb +9 -1
- data/lib/stytch/oauth.rb +9 -1
- data/lib/stytch/otps.rb +9 -1
- data/lib/stytch/passwords.rb +47 -6
- data/lib/stytch/sessions.rb +27 -3
- data/lib/stytch/totps.rb +18 -2
- data/lib/stytch/users.rb +3 -0
- data/lib/stytch/version.rb +1 -1
- data/lib/stytch/webauthn.rb +18 -2
- metadata +2 -2
data/lib/stytch/b2b_passwords.rb
CHANGED
@@ -284,6 +284,9 @@ module StytchB2B
|
|
284
284
|
# intermediate_session_token::
|
285
285
|
# Adds this primary authentication factor to the intermediate session token. If the resulting set of factors satisfies the organization's primary authentication requirements and MFA requirements, the intermediate session token will be consumed and converted to a member session. If not, the same intermediate session token will be returned.
|
286
286
|
# The type of this field is nilable +String+.
|
287
|
+
# telemetry_id::
|
288
|
+
# If the `telemetry_id` is passed, as part of this request, Stytch will call the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) and store the associated fingerprints and IPGEO information for the Member. Your workspace must be enabled for Device Fingerprinting to use this feature.
|
289
|
+
# The type of this field is nilable +String+.
|
287
290
|
#
|
288
291
|
# == Returns:
|
289
292
|
# An object with the following fields:
|
@@ -326,6 +329,9 @@ module StytchB2B
|
|
326
329
|
# primary_required::
|
327
330
|
# Information about the primary authentication requirements of the Organization.
|
328
331
|
# The type of this field is nilable +PrimaryRequired+ (+object+).
|
332
|
+
# member_device::
|
333
|
+
# If a valid `telemetry_id` was passed in the request and the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) returned results, the `member_device` response field will contain information about the member's device attributes.
|
334
|
+
# The type of this field is nilable +DeviceInfo+ (+object+).
|
329
335
|
def authenticate(
|
330
336
|
organization_id:,
|
331
337
|
email_address:,
|
@@ -335,7 +341,8 @@ module StytchB2B
|
|
335
341
|
session_jwt: nil,
|
336
342
|
session_custom_claims: nil,
|
337
343
|
locale: nil,
|
338
|
-
intermediate_session_token: nil
|
344
|
+
intermediate_session_token: nil,
|
345
|
+
telemetry_id: nil
|
339
346
|
)
|
340
347
|
headers = {}
|
341
348
|
request = {
|
@@ -349,6 +356,7 @@ module StytchB2B
|
|
349
356
|
request[:session_custom_claims] = session_custom_claims unless session_custom_claims.nil?
|
350
357
|
request[:locale] = locale unless locale.nil?
|
351
358
|
request[:intermediate_session_token] = intermediate_session_token unless intermediate_session_token.nil?
|
359
|
+
request[:telemetry_id] = telemetry_id unless telemetry_id.nil?
|
352
360
|
|
353
361
|
post_request('/v1/b2b/passwords/authenticate', request, headers)
|
354
362
|
end
|
@@ -534,6 +542,9 @@ module StytchB2B
|
|
534
542
|
# intermediate_session_token::
|
535
543
|
# Adds this primary authentication factor to the intermediate session token. If the resulting set of factors satisfies the organization's primary authentication requirements and MFA requirements, the intermediate session token will be consumed and converted to a member session. If not, the same intermediate session token will be returned.
|
536
544
|
# The type of this field is nilable +String+.
|
545
|
+
# telemetry_id::
|
546
|
+
# If the `telemetry_id` is passed, as part of this request, Stytch will call the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) and store the associated fingerprints and IPGEO information for the Member. Your workspace must be enabled for Device Fingerprinting to use this feature.
|
547
|
+
# The type of this field is nilable +String+.
|
537
548
|
#
|
538
549
|
# == Returns:
|
539
550
|
# An object with the following fields:
|
@@ -579,6 +590,9 @@ module StytchB2B
|
|
579
590
|
# primary_required::
|
580
591
|
# Information about the primary authentication requirements of the Organization.
|
581
592
|
# The type of this field is nilable +PrimaryRequired+ (+object+).
|
593
|
+
# member_device::
|
594
|
+
# If a valid `telemetry_id` was passed in the request and the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) returned results, the `member_device` response field will contain information about the member's device attributes.
|
595
|
+
# The type of this field is nilable +DeviceInfo+ (+object+).
|
582
596
|
def reset(
|
583
597
|
password_reset_token:,
|
584
598
|
password:,
|
@@ -588,7 +602,8 @@ module StytchB2B
|
|
588
602
|
code_verifier: nil,
|
589
603
|
session_custom_claims: nil,
|
590
604
|
locale: nil,
|
591
|
-
intermediate_session_token: nil
|
605
|
+
intermediate_session_token: nil,
|
606
|
+
telemetry_id: nil
|
592
607
|
)
|
593
608
|
headers = {}
|
594
609
|
request = {
|
@@ -602,6 +617,7 @@ module StytchB2B
|
|
602
617
|
request[:session_custom_claims] = session_custom_claims unless session_custom_claims.nil?
|
603
618
|
request[:locale] = locale unless locale.nil?
|
604
619
|
request[:intermediate_session_token] = intermediate_session_token unless intermediate_session_token.nil?
|
620
|
+
request[:telemetry_id] = telemetry_id unless telemetry_id.nil?
|
605
621
|
|
606
622
|
post_request('/v1/b2b/passwords/email/reset', request, headers)
|
607
623
|
end
|
@@ -709,6 +725,9 @@ module StytchB2B
|
|
709
725
|
# Request support for additional languages [here](https://docs.google.com/forms/d/e/1FAIpQLScZSpAu_m2AmLXRT3F3kap-s_mcV6UTBitYn6CdyWP0-o7YjQ/viewform?usp=sf_link")!
|
710
726
|
#
|
711
727
|
# The type of this field is nilable +ResetRequestLocale+ (string enum).
|
728
|
+
# telemetry_id::
|
729
|
+
# If the `telemetry_id` is passed, as part of this request, Stytch will call the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) and store the associated fingerprints and IPGEO information for the Member. Your workspace must be enabled for Device Fingerprinting to use this feature.
|
730
|
+
# The type of this field is nilable +String+.
|
712
731
|
#
|
713
732
|
# == Returns:
|
714
733
|
# An object with the following fields:
|
@@ -745,6 +764,9 @@ module StytchB2B
|
|
745
764
|
# mfa_required::
|
746
765
|
# Information about the MFA requirements of the Organization and the Member's options for fulfilling MFA.
|
747
766
|
# The type of this field is nilable +MfaRequired+ (+object+).
|
767
|
+
# member_device::
|
768
|
+
# If a valid `telemetry_id` was passed in the request and the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) returned results, the `member_device` response field will contain information about the member's device attributes.
|
769
|
+
# The type of this field is nilable +DeviceInfo+ (+object+).
|
748
770
|
def reset(
|
749
771
|
organization_id:,
|
750
772
|
password:,
|
@@ -752,7 +774,8 @@ module StytchB2B
|
|
752
774
|
session_jwt: nil,
|
753
775
|
session_duration_minutes: nil,
|
754
776
|
session_custom_claims: nil,
|
755
|
-
locale: nil
|
777
|
+
locale: nil,
|
778
|
+
telemetry_id: nil
|
756
779
|
)
|
757
780
|
headers = {}
|
758
781
|
request = {
|
@@ -764,6 +787,7 @@ module StytchB2B
|
|
764
787
|
request[:session_duration_minutes] = session_duration_minutes unless session_duration_minutes.nil?
|
765
788
|
request[:session_custom_claims] = session_custom_claims unless session_custom_claims.nil?
|
766
789
|
request[:locale] = locale unless locale.nil?
|
790
|
+
request[:telemetry_id] = telemetry_id unless telemetry_id.nil?
|
767
791
|
|
768
792
|
post_request('/v1/b2b/passwords/session/reset', request, headers)
|
769
793
|
end
|
@@ -839,6 +863,9 @@ module StytchB2B
|
|
839
863
|
# Request support for additional languages [here](https://docs.google.com/forms/d/e/1FAIpQLScZSpAu_m2AmLXRT3F3kap-s_mcV6UTBitYn6CdyWP0-o7YjQ/viewform?usp=sf_link")!
|
840
864
|
#
|
841
865
|
# The type of this field is nilable +ResetRequestLocale+ (string enum).
|
866
|
+
# telemetry_id::
|
867
|
+
# If the `telemetry_id` is passed, as part of this request, Stytch will call the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) and store the associated fingerprints and IPGEO information for the Member. Your workspace must be enabled for Device Fingerprinting to use this feature.
|
868
|
+
# The type of this field is nilable +String+.
|
842
869
|
#
|
843
870
|
# == Returns:
|
844
871
|
# An object with the following fields:
|
@@ -878,6 +905,9 @@ module StytchB2B
|
|
878
905
|
# primary_required::
|
879
906
|
# Information about the primary authentication requirements of the Organization.
|
880
907
|
# The type of this field is nilable +PrimaryRequired+ (+object+).
|
908
|
+
# member_device::
|
909
|
+
# If a valid `telemetry_id` was passed in the request and the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) returned results, the `member_device` response field will contain information about the member's device attributes.
|
910
|
+
# The type of this field is nilable +DeviceInfo+ (+object+).
|
881
911
|
def reset(
|
882
912
|
email_address:,
|
883
913
|
existing_password:,
|
@@ -887,7 +917,8 @@ module StytchB2B
|
|
887
917
|
session_duration_minutes: nil,
|
888
918
|
session_jwt: nil,
|
889
919
|
session_custom_claims: nil,
|
890
|
-
locale: nil
|
920
|
+
locale: nil,
|
921
|
+
telemetry_id: nil
|
891
922
|
)
|
892
923
|
headers = {}
|
893
924
|
request = {
|
@@ -901,6 +932,7 @@ module StytchB2B
|
|
901
932
|
request[:session_jwt] = session_jwt unless session_jwt.nil?
|
902
933
|
request[:session_custom_claims] = session_custom_claims unless session_custom_claims.nil?
|
903
934
|
request[:locale] = locale unless locale.nil?
|
935
|
+
request[:telemetry_id] = telemetry_id unless telemetry_id.nil?
|
904
936
|
|
905
937
|
post_request('/v1/b2b/passwords/existing_password/reset', request, headers)
|
906
938
|
end
|
@@ -55,6 +55,9 @@ module StytchB2B
|
|
55
55
|
# delete a key, supply a null value. Custom claims made with reserved claims (`iss`, `sub`, `aud`, `exp`, `nbf`, `iat`, `jti`) will be ignored.
|
56
56
|
# Total custom claims size cannot exceed four kilobytes.
|
57
57
|
# The type of this field is nilable +object+.
|
58
|
+
# telemetry_id::
|
59
|
+
# If the `telemetry_id` is passed, as part of this request, Stytch will call the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) and store the associated fingerprints and IPGEO information for the Member. Your workspace must be enabled for Device Fingerprinting to use this feature.
|
60
|
+
# The type of this field is nilable +String+.
|
58
61
|
#
|
59
62
|
# == Returns:
|
60
63
|
# An object with the following fields:
|
@@ -85,6 +88,9 @@ module StytchB2B
|
|
85
88
|
# member_session::
|
86
89
|
# The [Session object](https://stytch.com/docs/b2b/api/session-object).
|
87
90
|
# The type of this field is nilable +MemberSession+ (+object+).
|
91
|
+
# member_device::
|
92
|
+
# If a valid `telemetry_id` was passed in the request and the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) returned results, the `member_device` response field will contain information about the member's device attributes.
|
93
|
+
# The type of this field is nilable +DeviceInfo+ (+object+).
|
88
94
|
def recover(
|
89
95
|
organization_id:,
|
90
96
|
member_id:,
|
@@ -93,7 +99,8 @@ module StytchB2B
|
|
93
99
|
session_token: nil,
|
94
100
|
session_jwt: nil,
|
95
101
|
session_duration_minutes: nil,
|
96
|
-
session_custom_claims: nil
|
102
|
+
session_custom_claims: nil,
|
103
|
+
telemetry_id: nil
|
97
104
|
)
|
98
105
|
headers = {}
|
99
106
|
request = {
|
@@ -106,6 +113,7 @@ module StytchB2B
|
|
106
113
|
request[:session_jwt] = session_jwt unless session_jwt.nil?
|
107
114
|
request[:session_duration_minutes] = session_duration_minutes unless session_duration_minutes.nil?
|
108
115
|
request[:session_custom_claims] = session_custom_claims unless session_custom_claims.nil?
|
116
|
+
request[:telemetry_id] = telemetry_id unless telemetry_id.nil?
|
109
117
|
|
110
118
|
post_request('/v1/b2b/recovery_codes/recover', request, headers)
|
111
119
|
end
|
data/lib/stytch/b2b_sessions.rb
CHANGED
@@ -284,6 +284,9 @@ module StytchB2B
|
|
284
284
|
# Request support for additional languages [here](https://docs.google.com/forms/d/e/1FAIpQLScZSpAu_m2AmLXRT3F3kap-s_mcV6UTBitYn6CdyWP0-o7YjQ/viewform?usp=sf_link")!
|
285
285
|
#
|
286
286
|
# The type of this field is nilable +ExchangeRequestLocale+ (string enum).
|
287
|
+
# telemetry_id::
|
288
|
+
# If the `telemetry_id` is passed, as part of this request, Stytch will call the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) and store the associated fingerprints and IPGEO information for the Member. Your workspace must be enabled for Device Fingerprinting to use this feature.
|
289
|
+
# The type of this field is nilable +String+.
|
287
290
|
#
|
288
291
|
# == Returns:
|
289
292
|
# An object with the following fields:
|
@@ -323,13 +326,17 @@ module StytchB2B
|
|
323
326
|
# primary_required::
|
324
327
|
# Information about the primary authentication requirements of the Organization.
|
325
328
|
# The type of this field is nilable +PrimaryRequired+ (+object+).
|
329
|
+
# member_device::
|
330
|
+
# If a valid `telemetry_id` was passed in the request and the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) returned results, the `member_device` response field will contain information about the member's device attributes.
|
331
|
+
# The type of this field is nilable +DeviceInfo+ (+object+).
|
326
332
|
def exchange(
|
327
333
|
organization_id:,
|
328
334
|
session_token: nil,
|
329
335
|
session_jwt: nil,
|
330
336
|
session_duration_minutes: nil,
|
331
337
|
session_custom_claims: nil,
|
332
|
-
locale: nil
|
338
|
+
locale: nil,
|
339
|
+
telemetry_id: nil
|
333
340
|
)
|
334
341
|
headers = {}
|
335
342
|
request = {
|
@@ -340,6 +347,7 @@ module StytchB2B
|
|
340
347
|
request[:session_duration_minutes] = session_duration_minutes unless session_duration_minutes.nil?
|
341
348
|
request[:session_custom_claims] = session_custom_claims unless session_custom_claims.nil?
|
342
349
|
request[:locale] = locale unless locale.nil?
|
350
|
+
request[:telemetry_id] = telemetry_id unless telemetry_id.nil?
|
343
351
|
|
344
352
|
post_request('/v1/b2b/sessions/exchange', request, headers)
|
345
353
|
end
|
@@ -375,6 +383,9 @@ module StytchB2B
|
|
375
383
|
# delete a key, supply a null value. Custom claims made with reserved claims (`iss`, `sub`, `aud`, `exp`, `nbf`, `iat`, `jti`) will be ignored.
|
376
384
|
# Total custom claims size cannot exceed four kilobytes.
|
377
385
|
# The type of this field is nilable +object+.
|
386
|
+
# telemetry_id::
|
387
|
+
# If the `telemetry_id` is passed, as part of this request, Stytch will call the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) and store the associated fingerprints and IPGEO information for the Member. Your workspace must be enabled for Device Fingerprinting to use this feature.
|
388
|
+
# The type of this field is nilable +String+.
|
378
389
|
#
|
379
390
|
# == Returns:
|
380
391
|
# An object with the following fields:
|
@@ -402,10 +413,14 @@ module StytchB2B
|
|
402
413
|
# member_session::
|
403
414
|
# The [Session object](https://stytch.com/docs/b2b/api/session-object).
|
404
415
|
# The type of this field is nilable +MemberSession+ (+object+).
|
416
|
+
# member_device::
|
417
|
+
# If a valid `telemetry_id` was passed in the request and the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) returned results, the `member_device` response field will contain information about the member's device attributes.
|
418
|
+
# The type of this field is nilable +DeviceInfo+ (+object+).
|
405
419
|
def exchange_access_token(
|
406
420
|
access_token:,
|
407
421
|
session_duration_minutes: nil,
|
408
|
-
session_custom_claims: nil
|
422
|
+
session_custom_claims: nil,
|
423
|
+
telemetry_id: nil
|
409
424
|
)
|
410
425
|
headers = {}
|
411
426
|
request = {
|
@@ -413,6 +428,7 @@ module StytchB2B
|
|
413
428
|
}
|
414
429
|
request[:session_duration_minutes] = session_duration_minutes unless session_duration_minutes.nil?
|
415
430
|
request[:session_custom_claims] = session_custom_claims unless session_custom_claims.nil?
|
431
|
+
request[:telemetry_id] = telemetry_id unless telemetry_id.nil?
|
416
432
|
|
417
433
|
post_request('/v1/b2b/sessions/exchange_access_token', request, headers)
|
418
434
|
end
|
@@ -420,15 +436,15 @@ module StytchB2B
|
|
420
436
|
# Exchange an auth token issued by a trusted identity provider for a Stytch session. You must first register a Trusted Auth Token profile in the Stytch dashboard [here](https://stytch.com/dashboard/trusted-auth-tokens). If a session token or session JWT is provided, it will add the trusted auth token as an authentication factor to the existing session.
|
421
437
|
#
|
422
438
|
# == Parameters:
|
423
|
-
# organization_id::
|
424
|
-
# The organization ID that the session should be authenticated in.
|
425
|
-
# The type of this field is +String+.
|
426
439
|
# profile_id::
|
427
440
|
# The ID of the trusted auth token profile to use for attestation.
|
428
441
|
# The type of this field is +String+.
|
429
442
|
# token::
|
430
443
|
# The trusted auth token to authenticate.
|
431
444
|
# The type of this field is +String+.
|
445
|
+
# organization_id::
|
446
|
+
# The organization ID that the session should be authenticated in.
|
447
|
+
# The type of this field is nilable +String+.
|
432
448
|
# session_duration_minutes::
|
433
449
|
# Set the session lifetime to be this many minutes from now. This will start a new session if one doesn't already exist,
|
434
450
|
# returning both an opaque `session_token` and `session_jwt` for this session. Remember that the `session_jwt` will have a fixed lifetime of
|
@@ -453,6 +469,9 @@ module StytchB2B
|
|
453
469
|
# session_jwt::
|
454
470
|
# The `session_jwt` for the session that you wish to add the trusted auth token authentication factor to.
|
455
471
|
# The type of this field is nilable +String+.
|
472
|
+
# telemetry_id::
|
473
|
+
# If the `telemetry_id` is passed, as part of this request, Stytch will call the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) and store the associated fingerprints and IPGEO information for the Member. Your workspace must be enabled for Device Fingerprinting to use this feature.
|
474
|
+
# The type of this field is nilable +String+.
|
456
475
|
#
|
457
476
|
# == Returns:
|
458
477
|
# An object with the following fields:
|
@@ -480,25 +499,30 @@ module StytchB2B
|
|
480
499
|
# status_code::
|
481
500
|
# 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.
|
482
501
|
# The type of this field is +Integer+.
|
502
|
+
# member_device::
|
503
|
+
# If a valid `telemetry_id` was passed in the request and the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) returned results, the `member_device` response field will contain information about the member's device attributes.
|
504
|
+
# The type of this field is nilable +DeviceInfo+ (+object+).
|
483
505
|
def attest(
|
484
|
-
organization_id:,
|
485
506
|
profile_id:,
|
486
507
|
token:,
|
508
|
+
organization_id: nil,
|
487
509
|
session_duration_minutes: nil,
|
488
510
|
session_custom_claims: nil,
|
489
511
|
session_token: nil,
|
490
|
-
session_jwt: nil
|
512
|
+
session_jwt: nil,
|
513
|
+
telemetry_id: nil
|
491
514
|
)
|
492
515
|
headers = {}
|
493
516
|
request = {
|
494
|
-
organization_id: organization_id,
|
495
517
|
profile_id: profile_id,
|
496
518
|
token: token
|
497
519
|
}
|
520
|
+
request[:organization_id] = organization_id unless organization_id.nil?
|
498
521
|
request[:session_duration_minutes] = session_duration_minutes unless session_duration_minutes.nil?
|
499
522
|
request[:session_custom_claims] = session_custom_claims unless session_custom_claims.nil?
|
500
523
|
request[:session_token] = session_token unless session_token.nil?
|
501
524
|
request[:session_jwt] = session_jwt unless session_jwt.nil?
|
525
|
+
request[:telemetry_id] = telemetry_id unless telemetry_id.nil?
|
502
526
|
|
503
527
|
post_request('/v1/b2b/sessions/attest', request, headers)
|
504
528
|
end
|
data/lib/stytch/b2b_sso.rb
CHANGED
@@ -188,6 +188,9 @@ module StytchB2B
|
|
188
188
|
# intermediate_session_token::
|
189
189
|
# Adds this primary authentication factor to the intermediate session token. If the resulting set of factors satisfies the organization's primary authentication requirements and MFA requirements, the intermediate session token will be consumed and converted to a member session. If not, the same intermediate session token will be returned.
|
190
190
|
# The type of this field is nilable +String+.
|
191
|
+
# telemetry_id::
|
192
|
+
# If the `telemetry_id` is passed, as part of this request, Stytch will call the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) and store the associated fingerprints and IPGEO information for the Member. Your workspace must be enabled for Device Fingerprinting to use this feature.
|
193
|
+
# The type of this field is nilable +String+.
|
191
194
|
#
|
192
195
|
# == Returns:
|
193
196
|
# An object with the following fields:
|
@@ -233,6 +236,9 @@ module StytchB2B
|
|
233
236
|
# primary_required::
|
234
237
|
# (no documentation yet)
|
235
238
|
# The type of this field is nilable +PrimaryRequired+ (+object+).
|
239
|
+
# member_device::
|
240
|
+
# If a valid `telemetry_id` was passed in the request and the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) returned results, the `member_device` response field will contain information about the member's device attributes.
|
241
|
+
# The type of this field is nilable +DeviceInfo+ (+object+).
|
236
242
|
def authenticate(
|
237
243
|
sso_token:,
|
238
244
|
pkce_code_verifier: nil,
|
@@ -241,7 +247,8 @@ module StytchB2B
|
|
241
247
|
session_duration_minutes: nil,
|
242
248
|
session_custom_claims: nil,
|
243
249
|
locale: nil,
|
244
|
-
intermediate_session_token: nil
|
250
|
+
intermediate_session_token: nil,
|
251
|
+
telemetry_id: nil
|
245
252
|
)
|
246
253
|
headers = {}
|
247
254
|
request = {
|
@@ -254,6 +261,7 @@ module StytchB2B
|
|
254
261
|
request[:session_custom_claims] = session_custom_claims unless session_custom_claims.nil?
|
255
262
|
request[:locale] = locale unless locale.nil?
|
256
263
|
request[:intermediate_session_token] = intermediate_session_token unless intermediate_session_token.nil?
|
264
|
+
request[:telemetry_id] = telemetry_id unless telemetry_id.nil?
|
257
265
|
|
258
266
|
post_request('/v1/b2b/sso/authenticate', request, headers)
|
259
267
|
end
|
data/lib/stytch/b2b_totps.rb
CHANGED
@@ -142,6 +142,9 @@ module StytchB2B
|
|
142
142
|
# set_default_mfa::
|
143
143
|
# If passed will set the authenticated method to the default MFA method. Completing an MFA authentication flow for the first time for a Member will implicitly set the method to the default MFA method. This option can be used to update the default MFA method if multiple are being used.
|
144
144
|
# The type of this field is nilable +Boolean+.
|
145
|
+
# telemetry_id::
|
146
|
+
# If the `telemetry_id` is passed, as part of this request, Stytch will call the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) and store the associated fingerprints and IPGEO information for the Member. Your workspace must be enabled for Device Fingerprinting to use this feature.
|
147
|
+
# The type of this field is nilable +String+.
|
145
148
|
#
|
146
149
|
# == Returns:
|
147
150
|
# An object with the following fields:
|
@@ -169,6 +172,9 @@ module StytchB2B
|
|
169
172
|
# member_session::
|
170
173
|
# The [Session object](https://stytch.com/docs/b2b/api/session-object).
|
171
174
|
# The type of this field is nilable +MemberSession+ (+object+).
|
175
|
+
# member_device::
|
176
|
+
# If a valid `telemetry_id` was passed in the request and the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) returned results, the `member_device` response field will contain information about the member's device attributes.
|
177
|
+
# The type of this field is nilable +DeviceInfo+ (+object+).
|
172
178
|
def authenticate(
|
173
179
|
organization_id:,
|
174
180
|
member_id:,
|
@@ -179,7 +185,8 @@ module StytchB2B
|
|
179
185
|
session_duration_minutes: nil,
|
180
186
|
session_custom_claims: nil,
|
181
187
|
set_mfa_enrollment: nil,
|
182
|
-
set_default_mfa: nil
|
188
|
+
set_default_mfa: nil,
|
189
|
+
telemetry_id: nil
|
183
190
|
)
|
184
191
|
headers = {}
|
185
192
|
request = {
|
@@ -194,6 +201,7 @@ module StytchB2B
|
|
194
201
|
request[:session_custom_claims] = session_custom_claims unless session_custom_claims.nil?
|
195
202
|
request[:set_mfa_enrollment] = set_mfa_enrollment unless set_mfa_enrollment.nil?
|
196
203
|
request[:set_default_mfa] = set_default_mfa unless set_default_mfa.nil?
|
204
|
+
request[:telemetry_id] = telemetry_id unless telemetry_id.nil?
|
197
205
|
|
198
206
|
post_request('/v1/b2b/totp/authenticate', request, headers)
|
199
207
|
end
|
data/lib/stytch/client.rb
CHANGED
@@ -28,7 +28,7 @@ module Stytch
|
|
28
28
|
class Client
|
29
29
|
ENVIRONMENTS = %i[live test].freeze
|
30
30
|
|
31
|
-
attr_reader :connected_app, :crypto_wallets, :fraud, :impersonation, :m2m, :magic_links, :oauth, :otps, :passwords, :project, :rbac, :sessions, :totps, :users, :webauthn
|
31
|
+
attr_reader :connected_app, :crypto_wallets, :fraud, :idp, :impersonation, :m2m, :magic_links, :oauth, :otps, :passwords, :project, :rbac, :sessions, :totps, :users, :webauthn
|
32
32
|
|
33
33
|
def initialize(project_id:, secret:, env: nil, fraud_env: nil, &block)
|
34
34
|
@api_host = api_host(env, project_id)
|
@@ -41,11 +41,11 @@ module Stytch
|
|
41
41
|
|
42
42
|
rbac = Stytch::RBAC.new(@connection)
|
43
43
|
@policy_cache = Stytch::PolicyCache.new(rbac_client: rbac)
|
44
|
-
@idp = Stytch::IDP.new(@connection, @project_id, @policy_cache)
|
45
44
|
|
46
45
|
@connected_app = Stytch::ConnectedApp.new(@connection)
|
47
46
|
@crypto_wallets = Stytch::CryptoWallets.new(@connection)
|
48
47
|
@fraud = Stytch::Fraud.new(@fraud_connection)
|
48
|
+
@idp = Stytch::IDP.new(@connection, @project_id, @policy_cache)
|
49
49
|
@impersonation = Stytch::Impersonation.new(@connection)
|
50
50
|
@m2m = Stytch::M2M.new(@connection, @project_id, @is_b2b_client)
|
51
51
|
@magic_links = Stytch::MagicLinks.new(@connection)
|
@@ -115,6 +115,9 @@ module Stytch
|
|
115
115
|
#
|
116
116
|
# Custom claims made with reserved claims ("iss", "sub", "aud", "exp", "nbf", "iat", "jti") will be ignored. Total custom claims size cannot exceed four kilobytes.
|
117
117
|
# The type of this field is nilable +object+.
|
118
|
+
# telemetry_id::
|
119
|
+
# If the `telemetry_id` is passed, as part of this request, Stytch will call the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) and store the associated fingerprints and IPGEO information for the User. Your workspace must be enabled for Device Fingerprinting to use this feature.
|
120
|
+
# The type of this field is nilable +String+.
|
118
121
|
#
|
119
122
|
# == Returns:
|
120
123
|
# An object with the following fields:
|
@@ -145,6 +148,9 @@ module Stytch
|
|
145
148
|
# siwe_params::
|
146
149
|
# The parameters of the Sign In With Ethereum (SIWE) message that was signed.
|
147
150
|
# The type of this field is nilable +SIWEParamsResponse+ (+object+).
|
151
|
+
# user_device::
|
152
|
+
# If a valid `telemetry_id` was passed in the request and the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) returned results, the `user_device` response field will contain information about the user's device attributes.
|
153
|
+
# The type of this field is nilable +DeviceInfo+ (+object+).
|
148
154
|
def authenticate(
|
149
155
|
crypto_wallet_type:,
|
150
156
|
crypto_wallet_address:,
|
@@ -152,7 +158,8 @@ module Stytch
|
|
152
158
|
session_token: nil,
|
153
159
|
session_duration_minutes: nil,
|
154
160
|
session_jwt: nil,
|
155
|
-
session_custom_claims: nil
|
161
|
+
session_custom_claims: nil,
|
162
|
+
telemetry_id: nil
|
156
163
|
)
|
157
164
|
headers = {}
|
158
165
|
request = {
|
@@ -164,6 +171,7 @@ module Stytch
|
|
164
171
|
request[:session_duration_minutes] = session_duration_minutes unless session_duration_minutes.nil?
|
165
172
|
request[:session_jwt] = session_jwt unless session_jwt.nil?
|
166
173
|
request[:session_custom_claims] = session_custom_claims unless session_custom_claims.nil?
|
174
|
+
request[:telemetry_id] = telemetry_id unless telemetry_id.nil?
|
167
175
|
|
168
176
|
post_request('/v1/crypto_wallets/authenticate', request, headers)
|
169
177
|
end
|