stytch 7.8.1 → 8.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/stytch/b2b_discovery.rb +1 -1
- data/lib/stytch/b2b_magic_links.rb +20 -1
- data/lib/stytch/b2b_oauth.rb +1 -1
- data/lib/stytch/b2b_organizations.rb +236 -47
- data/lib/stytch/b2b_scim.rb +140 -7
- data/lib/stytch/b2b_sessions.rb +4 -2
- data/lib/stytch/b2b_sso.rb +177 -40
- data/lib/stytch/sessions.rb +5 -1
- data/lib/stytch/version.rb +1 -1
- data/lib/stytch.rb +1 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 641a8f3466452e18a1f85ed1f410a575100ca512de0118a638735dc93d2f5842
|
4
|
+
data.tar.gz: 31a2da5d7789dc4bdf160654201dfcbe8000d3c76450aa7b09f4c63247eaa644
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1141d505b32c4184040a2637da78dcc255cf9d07488cb411edeb0d382edba1343df9b571f7eddcb678b5253fe0ce90b2e9897bc21432c980a472ee54ad20442d
|
7
|
+
data.tar.gz: f4bd6e921c39ae22ca405e6c6b1b5c300a2a23da5b3986faf4d04db5199c50488aadb4082710e4fb2422b755849f3dae9777664d368a7120dddf5d553bf0f7ea
|
data/lib/stytch/b2b_discovery.rb
CHANGED
@@ -147,7 +147,7 @@ module StytchB2B
|
|
147
147
|
# This endpoint will also create an initial Member Session for the newly created Member.
|
148
148
|
#
|
149
149
|
# The Member created by this endpoint will automatically be granted the `stytch_admin` Role. See the
|
150
|
-
# [RBAC guide](https://stytch.com/docs/b2b/guides/rbac/stytch-
|
150
|
+
# [RBAC guide](https://stytch.com/docs/b2b/guides/rbac/stytch-default) for more details on this Role.
|
151
151
|
#
|
152
152
|
# If the new Organization is created with a `mfa_policy` of `REQUIRED_FOR_ALL`, the newly created Member will need to complete an MFA step to log in to the Organization.
|
153
153
|
# The `intermediate_session_token` will not be consumed and instead will be returned in the response.
|
@@ -151,6 +151,25 @@ module StytchB2B
|
|
151
151
|
end
|
152
152
|
|
153
153
|
class Email
|
154
|
+
class InviteRequestOptions
|
155
|
+
# Optional authorization object.
|
156
|
+
# Pass in an active Stytch Member session token or session JWT and the request
|
157
|
+
# will be run using that member's permissions.
|
158
|
+
attr_accessor :authorization
|
159
|
+
|
160
|
+
def initialize(
|
161
|
+
authorization: nil
|
162
|
+
)
|
163
|
+
@authorization = authorization
|
164
|
+
end
|
165
|
+
|
166
|
+
def to_headers
|
167
|
+
headers = {}
|
168
|
+
headers.merge!(@authorization.to_headers) if authorization
|
169
|
+
headers
|
170
|
+
end
|
171
|
+
end
|
172
|
+
|
154
173
|
include Stytch::RequestHelper
|
155
174
|
attr_reader :discovery
|
156
175
|
|
@@ -308,7 +327,7 @@ module StytchB2B
|
|
308
327
|
# The type of this field is +Integer+.
|
309
328
|
#
|
310
329
|
# == Method Options:
|
311
|
-
# This method supports an optional +InviteRequestOptions+ object which will modify the headers sent in the HTTP request.
|
330
|
+
# This method supports an optional +StytchB2B::MagicLinks::Email::InviteRequestOptions+ object which will modify the headers sent in the HTTP request.
|
312
331
|
def invite(
|
313
332
|
organization_id:,
|
314
333
|
email_address:,
|
data/lib/stytch/b2b_oauth.rb
CHANGED
@@ -122,7 +122,7 @@ module StytchB2B
|
|
122
122
|
# provider_values::
|
123
123
|
# 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.
|
124
124
|
#
|
125
|
-
# Note that these values will vary based on the OAuth provider in question, e.g. `id_token` is only returned by Microsoft.
|
125
|
+
# Note that these values will vary based on the OAuth provider in question, e.g. `id_token` is only returned by Microsoft. Google One Tap does not return access tokens or refresh tokens.
|
126
126
|
# The type of this field is nilable +ProviderValues+ (+object+).
|
127
127
|
# mfa_required::
|
128
128
|
# Information about the MFA requirements of the Organization and the Member's options for fulfilling MFA.
|
@@ -9,45 +9,45 @@
|
|
9
9
|
require_relative 'request_helper'
|
10
10
|
|
11
11
|
module StytchB2B
|
12
|
-
class
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
def initialize(
|
19
|
-
authorization: nil
|
20
|
-
)
|
21
|
-
@authorization = authorization
|
22
|
-
end
|
12
|
+
class Organizations
|
13
|
+
class UpdateRequestOptions
|
14
|
+
# Optional authorization object.
|
15
|
+
# Pass in an active Stytch Member session token or session JWT and the request
|
16
|
+
# will be run using that member's permissions.
|
17
|
+
attr_accessor :authorization
|
23
18
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
19
|
+
def initialize(
|
20
|
+
authorization: nil
|
21
|
+
)
|
22
|
+
@authorization = authorization
|
23
|
+
end
|
24
|
+
|
25
|
+
def to_headers
|
26
|
+
headers = {}
|
27
|
+
headers.merge!(@authorization.to_headers) if authorization
|
28
|
+
headers
|
29
|
+
end
|
28
30
|
end
|
29
|
-
end
|
30
31
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
32
|
+
class DeleteRequestOptions
|
33
|
+
# Optional authorization object.
|
34
|
+
# Pass in an active Stytch Member session token or session JWT and the request
|
35
|
+
# will be run using that member's permissions.
|
36
|
+
attr_accessor :authorization
|
36
37
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
38
|
+
def initialize(
|
39
|
+
authorization: nil
|
40
|
+
)
|
41
|
+
@authorization = authorization
|
42
|
+
end
|
42
43
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
44
|
+
def to_headers
|
45
|
+
headers = {}
|
46
|
+
headers.merge!(@authorization.to_headers) if authorization
|
47
|
+
headers
|
48
|
+
end
|
47
49
|
end
|
48
|
-
end
|
49
50
|
|
50
|
-
class Organizations
|
51
51
|
include Stytch::RequestHelper
|
52
52
|
attr_reader :members
|
53
53
|
|
@@ -385,7 +385,7 @@ module StytchB2B
|
|
385
385
|
# The type of this field is +Integer+.
|
386
386
|
#
|
387
387
|
# == Method Options:
|
388
|
-
# This method supports an optional +UpdateRequestOptions+ object which will modify the headers sent in the HTTP request.
|
388
|
+
# This method supports an optional +StytchB2B::Organizations::UpdateRequestOptions+ object which will modify the headers sent in the HTTP request.
|
389
389
|
def update(
|
390
390
|
organization_id:,
|
391
391
|
organization_name: nil,
|
@@ -449,7 +449,7 @@ module StytchB2B
|
|
449
449
|
# The type of this field is +Integer+.
|
450
450
|
#
|
451
451
|
# == Method Options:
|
452
|
-
# This method supports an optional +DeleteRequestOptions+ object which will modify the headers sent in the HTTP request.
|
452
|
+
# This method supports an optional +StytchB2B::Organizations::DeleteRequestOptions+ object which will modify the headers sent in the HTTP request.
|
453
453
|
def delete(
|
454
454
|
organization_id:,
|
455
455
|
method_options: nil
|
@@ -510,6 +510,158 @@ module StytchB2B
|
|
510
510
|
end
|
511
511
|
|
512
512
|
class Members
|
513
|
+
class UpdateRequestOptions
|
514
|
+
# Optional authorization object.
|
515
|
+
# Pass in an active Stytch Member session token or session JWT and the request
|
516
|
+
# will be run using that member's permissions.
|
517
|
+
attr_accessor :authorization
|
518
|
+
|
519
|
+
def initialize(
|
520
|
+
authorization: nil
|
521
|
+
)
|
522
|
+
@authorization = authorization
|
523
|
+
end
|
524
|
+
|
525
|
+
def to_headers
|
526
|
+
headers = {}
|
527
|
+
headers.merge!(@authorization.to_headers) if authorization
|
528
|
+
headers
|
529
|
+
end
|
530
|
+
end
|
531
|
+
|
532
|
+
class DeleteRequestOptions
|
533
|
+
# Optional authorization object.
|
534
|
+
# Pass in an active Stytch Member session token or session JWT and the request
|
535
|
+
# will be run using that member's permissions.
|
536
|
+
attr_accessor :authorization
|
537
|
+
|
538
|
+
def initialize(
|
539
|
+
authorization: nil
|
540
|
+
)
|
541
|
+
@authorization = authorization
|
542
|
+
end
|
543
|
+
|
544
|
+
def to_headers
|
545
|
+
headers = {}
|
546
|
+
headers.merge!(@authorization.to_headers) if authorization
|
547
|
+
headers
|
548
|
+
end
|
549
|
+
end
|
550
|
+
|
551
|
+
class ReactivateRequestOptions
|
552
|
+
# Optional authorization object.
|
553
|
+
# Pass in an active Stytch Member session token or session JWT and the request
|
554
|
+
# will be run using that member's permissions.
|
555
|
+
attr_accessor :authorization
|
556
|
+
|
557
|
+
def initialize(
|
558
|
+
authorization: nil
|
559
|
+
)
|
560
|
+
@authorization = authorization
|
561
|
+
end
|
562
|
+
|
563
|
+
def to_headers
|
564
|
+
headers = {}
|
565
|
+
headers.merge!(@authorization.to_headers) if authorization
|
566
|
+
headers
|
567
|
+
end
|
568
|
+
end
|
569
|
+
|
570
|
+
class DeleteMFAPhoneNumberRequestOptions
|
571
|
+
# Optional authorization object.
|
572
|
+
# Pass in an active Stytch Member session token or session JWT and the request
|
573
|
+
# will be run using that member's permissions.
|
574
|
+
attr_accessor :authorization
|
575
|
+
|
576
|
+
def initialize(
|
577
|
+
authorization: nil
|
578
|
+
)
|
579
|
+
@authorization = authorization
|
580
|
+
end
|
581
|
+
|
582
|
+
def to_headers
|
583
|
+
headers = {}
|
584
|
+
headers.merge!(@authorization.to_headers) if authorization
|
585
|
+
headers
|
586
|
+
end
|
587
|
+
end
|
588
|
+
|
589
|
+
class DeleteTOTPRequestOptions
|
590
|
+
# Optional authorization object.
|
591
|
+
# Pass in an active Stytch Member session token or session JWT and the request
|
592
|
+
# will be run using that member's permissions.
|
593
|
+
attr_accessor :authorization
|
594
|
+
|
595
|
+
def initialize(
|
596
|
+
authorization: nil
|
597
|
+
)
|
598
|
+
@authorization = authorization
|
599
|
+
end
|
600
|
+
|
601
|
+
def to_headers
|
602
|
+
headers = {}
|
603
|
+
headers.merge!(@authorization.to_headers) if authorization
|
604
|
+
headers
|
605
|
+
end
|
606
|
+
end
|
607
|
+
|
608
|
+
class SearchRequestOptions
|
609
|
+
# Optional authorization object.
|
610
|
+
# Pass in an active Stytch Member session token or session JWT and the request
|
611
|
+
# will be run using that member's permissions.
|
612
|
+
attr_accessor :authorization
|
613
|
+
|
614
|
+
def initialize(
|
615
|
+
authorization: nil
|
616
|
+
)
|
617
|
+
@authorization = authorization
|
618
|
+
end
|
619
|
+
|
620
|
+
def to_headers
|
621
|
+
headers = {}
|
622
|
+
headers.merge!(@authorization.to_headers) if authorization
|
623
|
+
headers
|
624
|
+
end
|
625
|
+
end
|
626
|
+
|
627
|
+
class DeletePasswordRequestOptions
|
628
|
+
# Optional authorization object.
|
629
|
+
# Pass in an active Stytch Member session token or session JWT and the request
|
630
|
+
# will be run using that member's permissions.
|
631
|
+
attr_accessor :authorization
|
632
|
+
|
633
|
+
def initialize(
|
634
|
+
authorization: nil
|
635
|
+
)
|
636
|
+
@authorization = authorization
|
637
|
+
end
|
638
|
+
|
639
|
+
def to_headers
|
640
|
+
headers = {}
|
641
|
+
headers.merge!(@authorization.to_headers) if authorization
|
642
|
+
headers
|
643
|
+
end
|
644
|
+
end
|
645
|
+
|
646
|
+
class CreateRequestOptions
|
647
|
+
# Optional authorization object.
|
648
|
+
# Pass in an active Stytch Member session token or session JWT and the request
|
649
|
+
# will be run using that member's permissions.
|
650
|
+
attr_accessor :authorization
|
651
|
+
|
652
|
+
def initialize(
|
653
|
+
authorization: nil
|
654
|
+
)
|
655
|
+
@authorization = authorization
|
656
|
+
end
|
657
|
+
|
658
|
+
def to_headers
|
659
|
+
headers = {}
|
660
|
+
headers.merge!(@authorization.to_headers) if authorization
|
661
|
+
headers
|
662
|
+
end
|
663
|
+
end
|
664
|
+
|
513
665
|
include Stytch::RequestHelper
|
514
666
|
attr_reader :oauth_providers
|
515
667
|
|
@@ -621,7 +773,7 @@ module StytchB2B
|
|
621
773
|
# The type of this field is +Integer+.
|
622
774
|
#
|
623
775
|
# == Method Options:
|
624
|
-
# This method supports an optional +UpdateRequestOptions+ object which will modify the headers sent in the HTTP request.
|
776
|
+
# This method supports an optional +StytchB2B::Organizations::Members::UpdateRequestOptions+ object which will modify the headers sent in the HTTP request.
|
625
777
|
def update(
|
626
778
|
organization_id:,
|
627
779
|
member_id:,
|
@@ -677,7 +829,7 @@ module StytchB2B
|
|
677
829
|
# The type of this field is +Integer+.
|
678
830
|
#
|
679
831
|
# == Method Options:
|
680
|
-
# This method supports an optional +DeleteRequestOptions+ object which will modify the headers sent in the HTTP request.
|
832
|
+
# This method supports an optional +StytchB2B::Organizations::Members::DeleteRequestOptions+ object which will modify the headers sent in the HTTP request.
|
681
833
|
def delete(
|
682
834
|
organization_id:,
|
683
835
|
member_id:,
|
@@ -717,7 +869,7 @@ module StytchB2B
|
|
717
869
|
# The type of this field is +Integer+.
|
718
870
|
#
|
719
871
|
# == Method Options:
|
720
|
-
# This method supports an optional +ReactivateRequestOptions+ object which will modify the headers sent in the HTTP request.
|
872
|
+
# This method supports an optional +StytchB2B::Organizations::Members::ReactivateRequestOptions+ object which will modify the headers sent in the HTTP request.
|
721
873
|
def reactivate(
|
722
874
|
organization_id:,
|
723
875
|
member_id:,
|
@@ -766,7 +918,7 @@ module StytchB2B
|
|
766
918
|
# The type of this field is +Integer+.
|
767
919
|
#
|
768
920
|
# == Method Options:
|
769
|
-
# This method supports an optional +DeleteMFAPhoneNumberRequestOptions+ object which will modify the headers sent in the HTTP request.
|
921
|
+
# This method supports an optional +StytchB2B::Organizations::Members::DeleteMFAPhoneNumberRequestOptions+ object which will modify the headers sent in the HTTP request.
|
770
922
|
def delete_mfa_phone_number(
|
771
923
|
organization_id:,
|
772
924
|
member_id:,
|
@@ -777,6 +929,41 @@ module StytchB2B
|
|
777
929
|
delete_request("/v1/b2b/organizations/#{organization_id}/members/mfa_phone_numbers/#{member_id}", headers)
|
778
930
|
end
|
779
931
|
|
932
|
+
# Delete a Member's MFA TOTP registration.
|
933
|
+
#
|
934
|
+
# To mint a new registration for a Member, you must first call this endpoint to delete the existing registration.
|
935
|
+
#
|
936
|
+
# Existing Member Sessions that include the TOTP authentication factor will not be revoked if the registration is deleted, and MFA will not be enforced until the Member logs in again.
|
937
|
+
# /%}
|
938
|
+
#
|
939
|
+
# == Parameters:
|
940
|
+
# organization_id::
|
941
|
+
# 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.
|
942
|
+
# The type of this field is +String+.
|
943
|
+
# member_id::
|
944
|
+
# Globally unique UUID that identifies a specific Member. The `member_id` is critical to perform operations on a Member, so be sure to preserve this value.
|
945
|
+
# The type of this field is +String+.
|
946
|
+
#
|
947
|
+
# == Returns:
|
948
|
+
# An object with the following fields:
|
949
|
+
# request_id::
|
950
|
+
# 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.
|
951
|
+
# The type of this field is +String+.
|
952
|
+
# member_id::
|
953
|
+
# Globally unique UUID that identifies a specific Member.
|
954
|
+
# The type of this field is +String+.
|
955
|
+
# member::
|
956
|
+
# The [Member object](https://stytch.com/docs/b2b/api/member-object)
|
957
|
+
# The type of this field is +Member+ (+object+).
|
958
|
+
# organization::
|
959
|
+
# The [Organization object](https://stytch.com/docs/b2b/api/organization-object).
|
960
|
+
# The type of this field is +Organization+ (+object+).
|
961
|
+
# status_code::
|
962
|
+
# 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.
|
963
|
+
# The type of this field is +Integer+.
|
964
|
+
#
|
965
|
+
# == Method Options:
|
966
|
+
# This method supports an optional +StytchB2B::Organizations::Members::DeleteTOTPRequestOptions+ object which will modify the headers sent in the HTTP request.
|
780
967
|
def delete_totp(
|
781
968
|
organization_id:,
|
782
969
|
member_id:,
|
@@ -836,7 +1023,7 @@ module StytchB2B
|
|
836
1023
|
# The type of this field is +Integer+.
|
837
1024
|
#
|
838
1025
|
# == Method Options:
|
839
|
-
# This method supports an optional +SearchRequestOptions+ object which will modify the headers sent in the HTTP request.
|
1026
|
+
# This method supports an optional +StytchB2B::Organizations::Members::SearchRequestOptions+ object which will modify the headers sent in the HTTP request.
|
840
1027
|
def search(
|
841
1028
|
organization_ids:,
|
842
1029
|
cursor: nil,
|
@@ -885,7 +1072,7 @@ module StytchB2B
|
|
885
1072
|
# The type of this field is +Integer+.
|
886
1073
|
#
|
887
1074
|
# == Method Options:
|
888
|
-
# This method supports an optional +DeletePasswordRequestOptions+ object which will modify the headers sent in the HTTP request.
|
1075
|
+
# This method supports an optional +StytchB2B::Organizations::Members::DeletePasswordRequestOptions+ object which will modify the headers sent in the HTTP request.
|
889
1076
|
def delete_password(
|
890
1077
|
organization_id:,
|
891
1078
|
member_password_id:,
|
@@ -985,7 +1172,7 @@ module StytchB2B
|
|
985
1172
|
# The type of this field is +Integer+.
|
986
1173
|
#
|
987
1174
|
# == Method Options:
|
988
|
-
# This method supports an optional +CreateRequestOptions+ object which will modify the headers sent in the HTTP request.
|
1175
|
+
# This method supports an optional +StytchB2B::Organizations::Members::CreateRequestOptions+ object which will modify the headers sent in the HTTP request.
|
989
1176
|
def create(
|
990
1177
|
organization_id:,
|
991
1178
|
email_address:,
|
@@ -1071,6 +1258,8 @@ module StytchB2B
|
|
1071
1258
|
# issued access token and ID token from the identity provider. If a refresh token has been issued, Stytch will refresh the
|
1072
1259
|
# access token automatically.
|
1073
1260
|
#
|
1261
|
+
# Google One Tap does not return access tokens. If the member has only authenticated through Google One Tap and not through a regular Google OAuth flow, this endpoint will not return any tokens.
|
1262
|
+
#
|
1074
1263
|
# __Note:__ Google does not issue a refresh token on every login, and refresh tokens may expire if unused.
|
1075
1264
|
# To force a refresh token to be issued, pass the `?provider_prompt=consent` query param into the
|
1076
1265
|
# [Start Google OAuth flow](https://stytch.com/docs/b2b/api/oauth-google-start) endpoint.
|
@@ -1097,12 +1286,6 @@ module StytchB2B
|
|
1097
1286
|
# provider_subject::
|
1098
1287
|
# The unique identifier for the User within a given OAuth provider. Also commonly called the `sub` or "Subject field" in OAuth protocols.
|
1099
1288
|
# The type of this field is +String+.
|
1100
|
-
# access_token::
|
1101
|
-
# The `access_token` that you may use to access the User's data in the provider's API.
|
1102
|
-
# The type of this field is +String+.
|
1103
|
-
# access_token_expires_in::
|
1104
|
-
# The number of seconds until the access token expires.
|
1105
|
-
# The type of this field is +Integer+.
|
1106
1289
|
# id_token::
|
1107
1290
|
# The `id_token` returned by the OAuth provider. ID Tokens are JWTs that contain structured information about a user. The exact content of each ID Token varies from provider to provider. ID Tokens are returned from OAuth providers that conform to the [OpenID Connect](https://openid.net/foundation/) specification, which is based on OAuth.
|
1108
1291
|
# The type of this field is +String+.
|
@@ -1112,6 +1295,12 @@ module StytchB2B
|
|
1112
1295
|
# status_code::
|
1113
1296
|
# 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.
|
1114
1297
|
# The type of this field is +Integer+.
|
1298
|
+
# access_token::
|
1299
|
+
# The `access_token` that you may use to access the User's data in the provider's API.
|
1300
|
+
# The type of this field is nilable +String+.
|
1301
|
+
# access_token_expires_in::
|
1302
|
+
# The number of seconds until the access token expires.
|
1303
|
+
# The type of this field is nilable +Integer+.
|
1115
1304
|
# refresh_token::
|
1116
1305
|
# The `refresh_token` that you may use to obtain a new `access_token` for the User within the provider's API.
|
1117
1306
|
# The type of this field is nilable +String+.
|
data/lib/stytch/b2b_scim.rb
CHANGED
@@ -20,6 +20,139 @@ module StytchB2B
|
|
20
20
|
end
|
21
21
|
|
22
22
|
class Connections
|
23
|
+
class UpdateRequestOptions
|
24
|
+
# Optional authorization object.
|
25
|
+
# Pass in an active Stytch Member session token or session JWT and the request
|
26
|
+
# will be run using that member's permissions.
|
27
|
+
attr_accessor :authorization
|
28
|
+
|
29
|
+
def initialize(
|
30
|
+
authorization: nil
|
31
|
+
)
|
32
|
+
@authorization = authorization
|
33
|
+
end
|
34
|
+
|
35
|
+
def to_headers
|
36
|
+
headers = {}
|
37
|
+
headers.merge!(@authorization.to_headers) if authorization
|
38
|
+
headers
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
class DeleteRequestOptions
|
43
|
+
# Optional authorization object.
|
44
|
+
# Pass in an active Stytch Member session token or session JWT and the request
|
45
|
+
# will be run using that member's permissions.
|
46
|
+
attr_accessor :authorization
|
47
|
+
|
48
|
+
def initialize(
|
49
|
+
authorization: nil
|
50
|
+
)
|
51
|
+
@authorization = authorization
|
52
|
+
end
|
53
|
+
|
54
|
+
def to_headers
|
55
|
+
headers = {}
|
56
|
+
headers.merge!(@authorization.to_headers) if authorization
|
57
|
+
headers
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
class RotateStartRequestOptions
|
62
|
+
# Optional authorization object.
|
63
|
+
# Pass in an active Stytch Member session token or session JWT and the request
|
64
|
+
# will be run using that member's permissions.
|
65
|
+
attr_accessor :authorization
|
66
|
+
|
67
|
+
def initialize(
|
68
|
+
authorization: nil
|
69
|
+
)
|
70
|
+
@authorization = authorization
|
71
|
+
end
|
72
|
+
|
73
|
+
def to_headers
|
74
|
+
headers = {}
|
75
|
+
headers.merge!(@authorization.to_headers) if authorization
|
76
|
+
headers
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
class RotateCompleteRequestOptions
|
81
|
+
# Optional authorization object.
|
82
|
+
# Pass in an active Stytch Member session token or session JWT and the request
|
83
|
+
# will be run using that member's permissions.
|
84
|
+
attr_accessor :authorization
|
85
|
+
|
86
|
+
def initialize(
|
87
|
+
authorization: nil
|
88
|
+
)
|
89
|
+
@authorization = authorization
|
90
|
+
end
|
91
|
+
|
92
|
+
def to_headers
|
93
|
+
headers = {}
|
94
|
+
headers.merge!(@authorization.to_headers) if authorization
|
95
|
+
headers
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
99
|
+
class RotateCancelRequestOptions
|
100
|
+
# Optional authorization object.
|
101
|
+
# Pass in an active Stytch Member session token or session JWT and the request
|
102
|
+
# will be run using that member's permissions.
|
103
|
+
attr_accessor :authorization
|
104
|
+
|
105
|
+
def initialize(
|
106
|
+
authorization: nil
|
107
|
+
)
|
108
|
+
@authorization = authorization
|
109
|
+
end
|
110
|
+
|
111
|
+
def to_headers
|
112
|
+
headers = {}
|
113
|
+
headers.merge!(@authorization.to_headers) if authorization
|
114
|
+
headers
|
115
|
+
end
|
116
|
+
end
|
117
|
+
|
118
|
+
class CreateRequestOptions
|
119
|
+
# Optional authorization object.
|
120
|
+
# Pass in an active Stytch Member session token or session JWT and the request
|
121
|
+
# will be run using that member's permissions.
|
122
|
+
attr_accessor :authorization
|
123
|
+
|
124
|
+
def initialize(
|
125
|
+
authorization: nil
|
126
|
+
)
|
127
|
+
@authorization = authorization
|
128
|
+
end
|
129
|
+
|
130
|
+
def to_headers
|
131
|
+
headers = {}
|
132
|
+
headers.merge!(@authorization.to_headers) if authorization
|
133
|
+
headers
|
134
|
+
end
|
135
|
+
end
|
136
|
+
|
137
|
+
class GetRequestOptions
|
138
|
+
# Optional authorization object.
|
139
|
+
# Pass in an active Stytch Member session token or session JWT and the request
|
140
|
+
# will be run using that member's permissions.
|
141
|
+
attr_accessor :authorization
|
142
|
+
|
143
|
+
def initialize(
|
144
|
+
authorization: nil
|
145
|
+
)
|
146
|
+
@authorization = authorization
|
147
|
+
end
|
148
|
+
|
149
|
+
def to_headers
|
150
|
+
headers = {}
|
151
|
+
headers.merge!(@authorization.to_headers) if authorization
|
152
|
+
headers
|
153
|
+
end
|
154
|
+
end
|
155
|
+
|
23
156
|
include Stytch::RequestHelper
|
24
157
|
|
25
158
|
def initialize(connection)
|
@@ -58,7 +191,7 @@ module StytchB2B
|
|
58
191
|
# The type of this field is nilable +SCIMConnection+ (+object+).
|
59
192
|
#
|
60
193
|
# == Method Options:
|
61
|
-
# This method supports an optional +UpdateRequestOptions+ object which will modify the headers sent in the HTTP request.
|
194
|
+
# This method supports an optional +StytchB2B::SCIM::Connections::UpdateRequestOptions+ object which will modify the headers sent in the HTTP request.
|
62
195
|
def update(
|
63
196
|
organization_id:,
|
64
197
|
connection_id:,
|
@@ -100,7 +233,7 @@ module StytchB2B
|
|
100
233
|
# The type of this field is +Integer+.
|
101
234
|
#
|
102
235
|
# == Method Options:
|
103
|
-
# This method supports an optional +DeleteRequestOptions+ object which will modify the headers sent in the HTTP request.
|
236
|
+
# This method supports an optional +StytchB2B::SCIM::Connections::DeleteRequestOptions+ object which will modify the headers sent in the HTTP request.
|
104
237
|
def delete(
|
105
238
|
organization_id:,
|
106
239
|
connection_id:,
|
@@ -134,7 +267,7 @@ module StytchB2B
|
|
134
267
|
# The type of this field is nilable +SCIMConnectionWithNextToken+ (+object+).
|
135
268
|
#
|
136
269
|
# == Method Options:
|
137
|
-
# This method supports an optional +RotateStartRequestOptions+ object which will modify the headers sent in the HTTP request.
|
270
|
+
# This method supports an optional +StytchB2B::SCIM::Connections::RotateStartRequestOptions+ object which will modify the headers sent in the HTTP request.
|
138
271
|
def rotate_start(
|
139
272
|
organization_id:,
|
140
273
|
connection_id:,
|
@@ -170,7 +303,7 @@ module StytchB2B
|
|
170
303
|
# The type of this field is nilable +SCIMConnection+ (+object+).
|
171
304
|
#
|
172
305
|
# == Method Options:
|
173
|
-
# This method supports an optional +RotateCompleteRequestOptions+ object which will modify the headers sent in the HTTP request.
|
306
|
+
# This method supports an optional +StytchB2B::SCIM::Connections::RotateCompleteRequestOptions+ object which will modify the headers sent in the HTTP request.
|
174
307
|
def rotate_complete(
|
175
308
|
organization_id:,
|
176
309
|
connection_id:,
|
@@ -206,7 +339,7 @@ module StytchB2B
|
|
206
339
|
# The type of this field is nilable +SCIMConnection+ (+object+).
|
207
340
|
#
|
208
341
|
# == Method Options:
|
209
|
-
# This method supports an optional +RotateCancelRequestOptions+ object which will modify the headers sent in the HTTP request.
|
342
|
+
# This method supports an optional +StytchB2B::SCIM::Connections::RotateCancelRequestOptions+ object which will modify the headers sent in the HTTP request.
|
210
343
|
def rotate_cancel(
|
211
344
|
organization_id:,
|
212
345
|
connection_id:,
|
@@ -245,7 +378,7 @@ module StytchB2B
|
|
245
378
|
# The type of this field is nilable +SCIMConnectionWithToken+ (+object+).
|
246
379
|
#
|
247
380
|
# == Method Options:
|
248
|
-
# This method supports an optional +CreateRequestOptions+ object which will modify the headers sent in the HTTP request.
|
381
|
+
# This method supports an optional +StytchB2B::SCIM::Connections::CreateRequestOptions+ object which will modify the headers sent in the HTTP request.
|
249
382
|
def create(
|
250
383
|
organization_id:,
|
251
384
|
display_name: nil,
|
@@ -281,7 +414,7 @@ module StytchB2B
|
|
281
414
|
# The type of this field is +Integer+.
|
282
415
|
#
|
283
416
|
# == Method Options:
|
284
|
-
# This method supports an optional +GetRequestOptions+ object which will modify the headers sent in the HTTP request.
|
417
|
+
# This method supports an optional +StytchB2B::SCIM::Connections::GetRequestOptions+ object which will modify the headers sent in the HTTP request.
|
285
418
|
def get(
|
286
419
|
organization_id:,
|
287
420
|
method_options: nil
|
data/lib/stytch/b2b_sessions.rb
CHANGED
@@ -70,7 +70,7 @@ module StytchB2B
|
|
70
70
|
|
71
71
|
# Authenticates a Session and updates its lifetime by the specified `session_duration_minutes`. If the `session_duration_minutes` is not specified, a Session will not be extended. This endpoint requires either a `session_jwt` or `session_token` be included in the request. It will return an error if both are present.
|
72
72
|
#
|
73
|
-
# You may provide a JWT that needs to be refreshed and is expired according to its `exp` claim. A new JWT will be returned if both the signature and the underlying Session are still valid.
|
73
|
+
# You may provide a JWT that needs to be refreshed and is expired according to its `exp` claim. A new JWT will be returned if both the signature and the underlying Session are still valid. See our [How to use Stytch Session JWTs](https://stytch.com/docs/b2b/guides/sessions/using-jwts) guide for more information.
|
74
74
|
#
|
75
75
|
# If an `authorization_check` object is passed in, this method will also check if the Member is authorized to perform the given action on the given Resource in the specified Organization. A Member is authorized if their Member Session contains a Role, assigned [explicitly or implicitly](https://stytch.com/docs/b2b/guides/rbac/role-assignment), with adequate permissions.
|
76
76
|
# In addition, the `organization_id` passed in the authorization check must match the Member's Organization.
|
@@ -316,7 +316,7 @@ module StytchB2B
|
|
316
316
|
post_request('/v1/b2b/sessions/exchange', request, headers)
|
317
317
|
end
|
318
318
|
|
319
|
-
# Migrate a session from an external OIDC compliant endpoint. Stytch will call the external UserInfo endpoint defined in your Stytch Project settings in the [Dashboard](/dashboard), and then perform a lookup using the `session_token`. If the response contains a valid email address, Stytch will attempt to match that email address with
|
319
|
+
# Migrate a session from an external OIDC compliant endpoint. Stytch will call the external UserInfo endpoint defined in your Stytch Project settings in the [Dashboard](/dashboard), and then perform a lookup using the `session_token`. If the response contains a valid email address, Stytch will attempt to match that email address with an existing Member in your Organization and create a Stytch Session. You will need to create the member before using this endpoint.
|
320
320
|
#
|
321
321
|
# == Parameters:
|
322
322
|
# session_token::
|
@@ -397,6 +397,8 @@ module StytchB2B
|
|
397
397
|
#
|
398
398
|
# If you're using your own JWT validation library, many have built-in support for JWKS rotation, and you'll just need to supply this API endpoint. If not, your application should decide which JWKS to use for validation by inspecting the `kid` value.
|
399
399
|
#
|
400
|
+
# See our [How to use Stytch Session JWTs](https://stytch.com/docs/b2b/guides/sessions/using-jwts) guide for more information.
|
401
|
+
#
|
400
402
|
# == Parameters:
|
401
403
|
# project_id::
|
402
404
|
# The `project_id` to get the JWKS for.
|
data/lib/stytch/b2b_sso.rb
CHANGED
@@ -9,45 +9,45 @@
|
|
9
9
|
require_relative 'request_helper'
|
10
10
|
|
11
11
|
module StytchB2B
|
12
|
-
class
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
def initialize(
|
19
|
-
authorization: nil
|
20
|
-
)
|
21
|
-
@authorization = authorization
|
22
|
-
end
|
12
|
+
class SSO
|
13
|
+
class GetConnectionsRequestOptions
|
14
|
+
# Optional authorization object.
|
15
|
+
# Pass in an active Stytch Member session token or session JWT and the request
|
16
|
+
# will be run using that member's permissions.
|
17
|
+
attr_accessor :authorization
|
23
18
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
19
|
+
def initialize(
|
20
|
+
authorization: nil
|
21
|
+
)
|
22
|
+
@authorization = authorization
|
23
|
+
end
|
24
|
+
|
25
|
+
def to_headers
|
26
|
+
headers = {}
|
27
|
+
headers.merge!(@authorization.to_headers) if authorization
|
28
|
+
headers
|
29
|
+
end
|
28
30
|
end
|
29
|
-
end
|
30
31
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
32
|
+
class DeleteConnectionRequestOptions
|
33
|
+
# Optional authorization object.
|
34
|
+
# Pass in an active Stytch Member session token or session JWT and the request
|
35
|
+
# will be run using that member's permissions.
|
36
|
+
attr_accessor :authorization
|
36
37
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
38
|
+
def initialize(
|
39
|
+
authorization: nil
|
40
|
+
)
|
41
|
+
@authorization = authorization
|
42
|
+
end
|
42
43
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
44
|
+
def to_headers
|
45
|
+
headers = {}
|
46
|
+
headers.merge!(@authorization.to_headers) if authorization
|
47
|
+
headers
|
48
|
+
end
|
47
49
|
end
|
48
|
-
end
|
49
50
|
|
50
|
-
class SSO
|
51
51
|
include Stytch::RequestHelper
|
52
52
|
attr_reader :oidc, :saml
|
53
53
|
|
@@ -76,12 +76,15 @@ module StytchB2B
|
|
76
76
|
# oidc_connections::
|
77
77
|
# The list of [OIDC Connections](https://stytch.com/docs/b2b/api/oidc-connection-object) owned by this organization.
|
78
78
|
# The type of this field is list of +OIDCConnection+ (+object+).
|
79
|
+
# external_connections::
|
80
|
+
# (no documentation yet)
|
81
|
+
# The type of this field is list of +Connection+ (+object+).
|
79
82
|
# status_code::
|
80
83
|
# 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.
|
81
84
|
# The type of this field is +Integer+.
|
82
85
|
#
|
83
86
|
# == Method Options:
|
84
|
-
# This method supports an optional +GetConnectionsRequestOptions+ object which will modify the headers sent in the HTTP request.
|
87
|
+
# This method supports an optional +StytchB2B::SSO::GetConnectionsRequestOptions+ object which will modify the headers sent in the HTTP request.
|
85
88
|
def get_connections(
|
86
89
|
organization_id:,
|
87
90
|
method_options: nil
|
@@ -116,7 +119,7 @@ module StytchB2B
|
|
116
119
|
# The type of this field is +Integer+.
|
117
120
|
#
|
118
121
|
# == Method Options:
|
119
|
-
# This method supports an optional +DeleteConnectionRequestOptions+ object which will modify the headers sent in the HTTP request.
|
122
|
+
# This method supports an optional +StytchB2B::SSO::DeleteConnectionRequestOptions+ object which will modify the headers sent in the HTTP request.
|
120
123
|
def delete_connection(
|
121
124
|
organization_id:,
|
122
125
|
connection_id:,
|
@@ -253,6 +256,44 @@ module StytchB2B
|
|
253
256
|
end
|
254
257
|
|
255
258
|
class OIDC
|
259
|
+
class CreateConnectionRequestOptions
|
260
|
+
# Optional authorization object.
|
261
|
+
# Pass in an active Stytch Member session token or session JWT and the request
|
262
|
+
# will be run using that member's permissions.
|
263
|
+
attr_accessor :authorization
|
264
|
+
|
265
|
+
def initialize(
|
266
|
+
authorization: nil
|
267
|
+
)
|
268
|
+
@authorization = authorization
|
269
|
+
end
|
270
|
+
|
271
|
+
def to_headers
|
272
|
+
headers = {}
|
273
|
+
headers.merge!(@authorization.to_headers) if authorization
|
274
|
+
headers
|
275
|
+
end
|
276
|
+
end
|
277
|
+
|
278
|
+
class UpdateConnectionRequestOptions
|
279
|
+
# Optional authorization object.
|
280
|
+
# Pass in an active Stytch Member session token or session JWT and the request
|
281
|
+
# will be run using that member's permissions.
|
282
|
+
attr_accessor :authorization
|
283
|
+
|
284
|
+
def initialize(
|
285
|
+
authorization: nil
|
286
|
+
)
|
287
|
+
@authorization = authorization
|
288
|
+
end
|
289
|
+
|
290
|
+
def to_headers
|
291
|
+
headers = {}
|
292
|
+
headers.merge!(@authorization.to_headers) if authorization
|
293
|
+
headers
|
294
|
+
end
|
295
|
+
end
|
296
|
+
|
256
297
|
include Stytch::RequestHelper
|
257
298
|
|
258
299
|
def initialize(connection)
|
@@ -268,6 +309,9 @@ module StytchB2B
|
|
268
309
|
# display_name::
|
269
310
|
# A human-readable display name for the connection.
|
270
311
|
# The type of this field is nilable +String+.
|
312
|
+
# identity_provider::
|
313
|
+
# The identity provider of this connection. For OIDC, the accepted values are `generic`, `okta`, and `microsoft-entra`. For SAML, the accepted values are `generic`, `okta`, `microsoft-entra`, and `google-workspace`.
|
314
|
+
# The type of this field is nilable +CreateConnectionRequestIdentityProvider+ (string enum).
|
271
315
|
#
|
272
316
|
# == Returns:
|
273
317
|
# An object with the following fields:
|
@@ -282,16 +326,18 @@ module StytchB2B
|
|
282
326
|
# The type of this field is nilable +OIDCConnection+ (+object+).
|
283
327
|
#
|
284
328
|
# == Method Options:
|
285
|
-
# This method supports an optional +CreateConnectionRequestOptions+ object which will modify the headers sent in the HTTP request.
|
329
|
+
# This method supports an optional +StytchB2B::SSO::OIDC::CreateConnectionRequestOptions+ object which will modify the headers sent in the HTTP request.
|
286
330
|
def create_connection(
|
287
331
|
organization_id:,
|
288
332
|
display_name: nil,
|
333
|
+
identity_provider: nil,
|
289
334
|
method_options: nil
|
290
335
|
)
|
291
336
|
headers = {}
|
292
337
|
headers = headers.merge(method_options.to_headers) unless method_options.nil?
|
293
338
|
request = {}
|
294
339
|
request[:display_name] = display_name unless display_name.nil?
|
340
|
+
request[:identity_provider] = identity_provider unless identity_provider.nil?
|
295
341
|
|
296
342
|
post_request("/v1/b2b/sso/oidc/#{organization_id}", request, headers)
|
297
343
|
end
|
@@ -347,6 +393,9 @@ module StytchB2B
|
|
347
393
|
# jwks_url::
|
348
394
|
# The location of the IdP's JSON Web Key Set, used to verify credentials issued by the IdP. This will be provided by the IdP.
|
349
395
|
# The type of this field is nilable +String+.
|
396
|
+
# identity_provider::
|
397
|
+
# The identity provider of this connection. For OIDC, the accepted values are `generic`, `okta`, and `microsoft-entra`. For SAML, the accepted values are `generic`, `okta`, `microsoft-entra`, and `google-workspace`.
|
398
|
+
# The type of this field is nilable +UpdateConnectionRequestIdentityProvider+ (string enum).
|
350
399
|
#
|
351
400
|
# == Returns:
|
352
401
|
# An object with the following fields:
|
@@ -364,7 +413,7 @@ module StytchB2B
|
|
364
413
|
# The type of this field is nilable +String+.
|
365
414
|
#
|
366
415
|
# == Method Options:
|
367
|
-
# This method supports an optional +UpdateConnectionRequestOptions+ object which will modify the headers sent in the HTTP request.
|
416
|
+
# This method supports an optional +StytchB2B::SSO::OIDC::UpdateConnectionRequestOptions+ object which will modify the headers sent in the HTTP request.
|
368
417
|
def update_connection(
|
369
418
|
organization_id:,
|
370
419
|
connection_id:,
|
@@ -376,6 +425,7 @@ module StytchB2B
|
|
376
425
|
token_url: nil,
|
377
426
|
userinfo_url: nil,
|
378
427
|
jwks_url: nil,
|
428
|
+
identity_provider: nil,
|
379
429
|
method_options: nil
|
380
430
|
)
|
381
431
|
headers = {}
|
@@ -389,12 +439,89 @@ module StytchB2B
|
|
389
439
|
request[:token_url] = token_url unless token_url.nil?
|
390
440
|
request[:userinfo_url] = userinfo_url unless userinfo_url.nil?
|
391
441
|
request[:jwks_url] = jwks_url unless jwks_url.nil?
|
442
|
+
request[:identity_provider] = identity_provider unless identity_provider.nil?
|
392
443
|
|
393
444
|
put_request("/v1/b2b/sso/oidc/#{organization_id}/connections/#{connection_id}", request, headers)
|
394
445
|
end
|
395
446
|
end
|
396
447
|
|
397
448
|
class SAML
|
449
|
+
class CreateConnectionRequestOptions
|
450
|
+
# Optional authorization object.
|
451
|
+
# Pass in an active Stytch Member session token or session JWT and the request
|
452
|
+
# will be run using that member's permissions.
|
453
|
+
attr_accessor :authorization
|
454
|
+
|
455
|
+
def initialize(
|
456
|
+
authorization: nil
|
457
|
+
)
|
458
|
+
@authorization = authorization
|
459
|
+
end
|
460
|
+
|
461
|
+
def to_headers
|
462
|
+
headers = {}
|
463
|
+
headers.merge!(@authorization.to_headers) if authorization
|
464
|
+
headers
|
465
|
+
end
|
466
|
+
end
|
467
|
+
|
468
|
+
class UpdateConnectionRequestOptions
|
469
|
+
# Optional authorization object.
|
470
|
+
# Pass in an active Stytch Member session token or session JWT and the request
|
471
|
+
# will be run using that member's permissions.
|
472
|
+
attr_accessor :authorization
|
473
|
+
|
474
|
+
def initialize(
|
475
|
+
authorization: nil
|
476
|
+
)
|
477
|
+
@authorization = authorization
|
478
|
+
end
|
479
|
+
|
480
|
+
def to_headers
|
481
|
+
headers = {}
|
482
|
+
headers.merge!(@authorization.to_headers) if authorization
|
483
|
+
headers
|
484
|
+
end
|
485
|
+
end
|
486
|
+
|
487
|
+
class UpdateByURLRequestOptions
|
488
|
+
# Optional authorization object.
|
489
|
+
# Pass in an active Stytch Member session token or session JWT and the request
|
490
|
+
# will be run using that member's permissions.
|
491
|
+
attr_accessor :authorization
|
492
|
+
|
493
|
+
def initialize(
|
494
|
+
authorization: nil
|
495
|
+
)
|
496
|
+
@authorization = authorization
|
497
|
+
end
|
498
|
+
|
499
|
+
def to_headers
|
500
|
+
headers = {}
|
501
|
+
headers.merge!(@authorization.to_headers) if authorization
|
502
|
+
headers
|
503
|
+
end
|
504
|
+
end
|
505
|
+
|
506
|
+
class DeleteVerificationCertificateRequestOptions
|
507
|
+
# Optional authorization object.
|
508
|
+
# Pass in an active Stytch Member session token or session JWT and the request
|
509
|
+
# will be run using that member's permissions.
|
510
|
+
attr_accessor :authorization
|
511
|
+
|
512
|
+
def initialize(
|
513
|
+
authorization: nil
|
514
|
+
)
|
515
|
+
@authorization = authorization
|
516
|
+
end
|
517
|
+
|
518
|
+
def to_headers
|
519
|
+
headers = {}
|
520
|
+
headers.merge!(@authorization.to_headers) if authorization
|
521
|
+
headers
|
522
|
+
end
|
523
|
+
end
|
524
|
+
|
398
525
|
include Stytch::RequestHelper
|
399
526
|
|
400
527
|
def initialize(connection)
|
@@ -410,6 +537,9 @@ module StytchB2B
|
|
410
537
|
# display_name::
|
411
538
|
# A human-readable display name for the connection.
|
412
539
|
# The type of this field is nilable +String+.
|
540
|
+
# identity_provider::
|
541
|
+
# The identity provider of this connection. For OIDC, the accepted values are `generic`, `okta`, and `microsoft-entra`. For SAML, the accepted values are `generic`, `okta`, `microsoft-entra`, and `google-workspace`.
|
542
|
+
# The type of this field is nilable +CreateConnectionRequestIdentityProvider+ (string enum).
|
413
543
|
#
|
414
544
|
# == Returns:
|
415
545
|
# An object with the following fields:
|
@@ -424,16 +554,18 @@ module StytchB2B
|
|
424
554
|
# The type of this field is nilable +SAMLConnection+ (+object+).
|
425
555
|
#
|
426
556
|
# == Method Options:
|
427
|
-
# This method supports an optional +CreateConnectionRequestOptions+ object which will modify the headers sent in the HTTP request.
|
557
|
+
# This method supports an optional +StytchB2B::SSO::SAML::CreateConnectionRequestOptions+ object which will modify the headers sent in the HTTP request.
|
428
558
|
def create_connection(
|
429
559
|
organization_id:,
|
430
560
|
display_name: nil,
|
561
|
+
identity_provider: nil,
|
431
562
|
method_options: nil
|
432
563
|
)
|
433
564
|
headers = {}
|
434
565
|
headers = headers.merge(method_options.to_headers) unless method_options.nil?
|
435
566
|
request = {}
|
436
567
|
request[:display_name] = display_name unless display_name.nil?
|
568
|
+
request[:identity_provider] = identity_provider unless identity_provider.nil?
|
437
569
|
|
438
570
|
post_request("/v1/b2b/sso/saml/#{organization_id}", request, headers)
|
439
571
|
end
|
@@ -483,6 +615,9 @@ module StytchB2B
|
|
483
615
|
# alternative_audience_uri::
|
484
616
|
# An alternative URL to use for the Audience Restriction. This value can be used when you wish to migrate an existing SAML integration to Stytch with zero downtime.
|
485
617
|
# The type of this field is nilable +String+.
|
618
|
+
# identity_provider::
|
619
|
+
# The identity provider of this connection. For OIDC, the accepted values are `generic`, `okta`, and `microsoft-entra`. For SAML, the accepted values are `generic`, `okta`, `microsoft-entra`, and `google-workspace`.
|
620
|
+
# The type of this field is nilable +UpdateConnectionRequestIdentityProvider+ (string enum).
|
486
621
|
#
|
487
622
|
# == Returns:
|
488
623
|
# An object with the following fields:
|
@@ -497,7 +632,7 @@ module StytchB2B
|
|
497
632
|
# The type of this field is nilable +SAMLConnection+ (+object+).
|
498
633
|
#
|
499
634
|
# == Method Options:
|
500
|
-
# This method supports an optional +UpdateConnectionRequestOptions+ object which will modify the headers sent in the HTTP request.
|
635
|
+
# This method supports an optional +StytchB2B::SSO::SAML::UpdateConnectionRequestOptions+ object which will modify the headers sent in the HTTP request.
|
501
636
|
def update_connection(
|
502
637
|
organization_id:,
|
503
638
|
connection_id:,
|
@@ -509,6 +644,7 @@ module StytchB2B
|
|
509
644
|
saml_connection_implicit_role_assignments: nil,
|
510
645
|
saml_group_implicit_role_assignments: nil,
|
511
646
|
alternative_audience_uri: nil,
|
647
|
+
identity_provider: nil,
|
512
648
|
method_options: nil
|
513
649
|
)
|
514
650
|
headers = {}
|
@@ -522,6 +658,7 @@ module StytchB2B
|
|
522
658
|
request[:saml_connection_implicit_role_assignments] = saml_connection_implicit_role_assignments unless saml_connection_implicit_role_assignments.nil?
|
523
659
|
request[:saml_group_implicit_role_assignments] = saml_group_implicit_role_assignments unless saml_group_implicit_role_assignments.nil?
|
524
660
|
request[:alternative_audience_uri] = alternative_audience_uri unless alternative_audience_uri.nil?
|
661
|
+
request[:identity_provider] = identity_provider unless identity_provider.nil?
|
525
662
|
|
526
663
|
put_request("/v1/b2b/sso/saml/#{organization_id}/connections/#{connection_id}", request, headers)
|
527
664
|
end
|
@@ -559,7 +696,7 @@ module StytchB2B
|
|
559
696
|
# The type of this field is nilable +SAMLConnection+ (+object+).
|
560
697
|
#
|
561
698
|
# == Method Options:
|
562
|
-
# This method supports an optional +UpdateByURLRequestOptions+ object which will modify the headers sent in the HTTP request.
|
699
|
+
# This method supports an optional +StytchB2B::SSO::SAML::UpdateByURLRequestOptions+ object which will modify the headers sent in the HTTP request.
|
563
700
|
def update_by_url(
|
564
701
|
organization_id:,
|
565
702
|
connection_id:,
|
@@ -604,7 +741,7 @@ module StytchB2B
|
|
604
741
|
# The type of this field is +Integer+.
|
605
742
|
#
|
606
743
|
# == Method Options:
|
607
|
-
# This method supports an optional +DeleteVerificationCertificateRequestOptions+ object which will modify the headers sent in the HTTP request.
|
744
|
+
# This method supports an optional +StytchB2B::SSO::SAML::DeleteVerificationCertificateRequestOptions+ object which will modify the headers sent in the HTTP request.
|
608
745
|
def delete_verification_certificate(
|
609
746
|
organization_id:,
|
610
747
|
connection_id:,
|
data/lib/stytch/sessions.rb
CHANGED
@@ -62,7 +62,9 @@ module Stytch
|
|
62
62
|
get_request(request, headers)
|
63
63
|
end
|
64
64
|
|
65
|
-
# Authenticate a session token and retrieve associated session data. If `session_duration_minutes` is included, update the lifetime of the session to be that many minutes from now. All timestamps are formatted according to the RFC 3339 standard and are expressed in UTC, e.g. `2021-12-29T12:33:09Z`. This endpoint requires exactly one `session_jwt` or `session_token` as part of the request. If both are included you will receive a `too_many_session_arguments` error.
|
65
|
+
# Authenticate a session token or session JWT and retrieve associated session data. If `session_duration_minutes` is included, update the lifetime of the session to be that many minutes from now. All timestamps are formatted according to the RFC 3339 standard and are expressed in UTC, e.g. `2021-12-29T12:33:09Z`. This endpoint requires exactly one `session_jwt` or `session_token` as part of the request. If both are included, you will receive a `too_many_session_arguments` error.
|
66
|
+
#
|
67
|
+
# You may provide a JWT that needs to be refreshed and is expired according to its `exp` claim. A new JWT will be returned if both the signature and the underlying Session are still valid. See our [How to use Stytch Session JWTs](https://stytch.com/docs/guides/sessions/using-jwts) guide for more information.
|
66
68
|
#
|
67
69
|
# == Parameters:
|
68
70
|
# session_token::
|
@@ -164,6 +166,8 @@ module Stytch
|
|
164
166
|
#
|
165
167
|
# If you're using your own JWT validation library, many have built-in support for JWKS rotation, and you'll just need to supply this API endpoint. If not, your application should decide which JWKS to use for validation by inspecting the `kid` value.
|
166
168
|
#
|
169
|
+
# See our [How to use Stytch Session JWTs](https://stytch.com/docs/guides/sessions/using-jwts) guide for more information.
|
170
|
+
#
|
167
171
|
# == Parameters:
|
168
172
|
# project_id::
|
169
173
|
# The `project_id` to get the JWKS for.
|
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:
|
4
|
+
version: 8.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: 2024-
|
11
|
+
date: 2024-05-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|