stytch 8.0.0 → 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_oauth.rb +1 -1
- data/lib/stytch/b2b_organizations.rb +43 -6
- data/lib/stytch/b2b_sessions.rb +4 -2
- data/lib/stytch/b2b_sso.rb +23 -0
- data/lib/stytch/sessions.rb +5 -1
- data/lib/stytch/version.rb +1 -1
- 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.
|
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.
|
@@ -929,6 +929,41 @@ module StytchB2B
|
|
929
929
|
delete_request("/v1/b2b/organizations/#{organization_id}/members/mfa_phone_numbers/#{member_id}", headers)
|
930
930
|
end
|
931
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.
|
932
967
|
def delete_totp(
|
933
968
|
organization_id:,
|
934
969
|
member_id:,
|
@@ -1223,6 +1258,8 @@ module StytchB2B
|
|
1223
1258
|
# issued access token and ID token from the identity provider. If a refresh token has been issued, Stytch will refresh the
|
1224
1259
|
# access token automatically.
|
1225
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
|
+
#
|
1226
1263
|
# __Note:__ Google does not issue a refresh token on every login, and refresh tokens may expire if unused.
|
1227
1264
|
# To force a refresh token to be issued, pass the `?provider_prompt=consent` query param into the
|
1228
1265
|
# [Start Google OAuth flow](https://stytch.com/docs/b2b/api/oauth-google-start) endpoint.
|
@@ -1249,12 +1286,6 @@ module StytchB2B
|
|
1249
1286
|
# provider_subject::
|
1250
1287
|
# The unique identifier for the User within a given OAuth provider. Also commonly called the `sub` or "Subject field" in OAuth protocols.
|
1251
1288
|
# The type of this field is +String+.
|
1252
|
-
# access_token::
|
1253
|
-
# The `access_token` that you may use to access the User's data in the provider's API.
|
1254
|
-
# The type of this field is +String+.
|
1255
|
-
# access_token_expires_in::
|
1256
|
-
# The number of seconds until the access token expires.
|
1257
|
-
# The type of this field is +Integer+.
|
1258
1289
|
# id_token::
|
1259
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.
|
1260
1291
|
# The type of this field is +String+.
|
@@ -1264,6 +1295,12 @@ module StytchB2B
|
|
1264
1295
|
# status_code::
|
1265
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.
|
1266
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+.
|
1267
1304
|
# refresh_token::
|
1268
1305
|
# The `refresh_token` that you may use to obtain a new `access_token` for the User within the provider's API.
|
1269
1306
|
# The type of this field is nilable +String+.
|
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
@@ -76,6 +76,9 @@ 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+.
|
@@ -306,6 +309,9 @@ module StytchB2B
|
|
306
309
|
# display_name::
|
307
310
|
# A human-readable display name for the connection.
|
308
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).
|
309
315
|
#
|
310
316
|
# == Returns:
|
311
317
|
# An object with the following fields:
|
@@ -324,12 +330,14 @@ module StytchB2B
|
|
324
330
|
def create_connection(
|
325
331
|
organization_id:,
|
326
332
|
display_name: nil,
|
333
|
+
identity_provider: nil,
|
327
334
|
method_options: nil
|
328
335
|
)
|
329
336
|
headers = {}
|
330
337
|
headers = headers.merge(method_options.to_headers) unless method_options.nil?
|
331
338
|
request = {}
|
332
339
|
request[:display_name] = display_name unless display_name.nil?
|
340
|
+
request[:identity_provider] = identity_provider unless identity_provider.nil?
|
333
341
|
|
334
342
|
post_request("/v1/b2b/sso/oidc/#{organization_id}", request, headers)
|
335
343
|
end
|
@@ -385,6 +393,9 @@ module StytchB2B
|
|
385
393
|
# jwks_url::
|
386
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.
|
387
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).
|
388
399
|
#
|
389
400
|
# == Returns:
|
390
401
|
# An object with the following fields:
|
@@ -414,6 +425,7 @@ module StytchB2B
|
|
414
425
|
token_url: nil,
|
415
426
|
userinfo_url: nil,
|
416
427
|
jwks_url: nil,
|
428
|
+
identity_provider: nil,
|
417
429
|
method_options: nil
|
418
430
|
)
|
419
431
|
headers = {}
|
@@ -427,6 +439,7 @@ module StytchB2B
|
|
427
439
|
request[:token_url] = token_url unless token_url.nil?
|
428
440
|
request[:userinfo_url] = userinfo_url unless userinfo_url.nil?
|
429
441
|
request[:jwks_url] = jwks_url unless jwks_url.nil?
|
442
|
+
request[:identity_provider] = identity_provider unless identity_provider.nil?
|
430
443
|
|
431
444
|
put_request("/v1/b2b/sso/oidc/#{organization_id}/connections/#{connection_id}", request, headers)
|
432
445
|
end
|
@@ -524,6 +537,9 @@ module StytchB2B
|
|
524
537
|
# display_name::
|
525
538
|
# A human-readable display name for the connection.
|
526
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).
|
527
543
|
#
|
528
544
|
# == Returns:
|
529
545
|
# An object with the following fields:
|
@@ -542,12 +558,14 @@ module StytchB2B
|
|
542
558
|
def create_connection(
|
543
559
|
organization_id:,
|
544
560
|
display_name: nil,
|
561
|
+
identity_provider: nil,
|
545
562
|
method_options: nil
|
546
563
|
)
|
547
564
|
headers = {}
|
548
565
|
headers = headers.merge(method_options.to_headers) unless method_options.nil?
|
549
566
|
request = {}
|
550
567
|
request[:display_name] = display_name unless display_name.nil?
|
568
|
+
request[:identity_provider] = identity_provider unless identity_provider.nil?
|
551
569
|
|
552
570
|
post_request("/v1/b2b/sso/saml/#{organization_id}", request, headers)
|
553
571
|
end
|
@@ -597,6 +615,9 @@ module StytchB2B
|
|
597
615
|
# alternative_audience_uri::
|
598
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.
|
599
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).
|
600
621
|
#
|
601
622
|
# == Returns:
|
602
623
|
# An object with the following fields:
|
@@ -623,6 +644,7 @@ module StytchB2B
|
|
623
644
|
saml_connection_implicit_role_assignments: nil,
|
624
645
|
saml_group_implicit_role_assignments: nil,
|
625
646
|
alternative_audience_uri: nil,
|
647
|
+
identity_provider: nil,
|
626
648
|
method_options: nil
|
627
649
|
)
|
628
650
|
headers = {}
|
@@ -636,6 +658,7 @@ module StytchB2B
|
|
636
658
|
request[:saml_connection_implicit_role_assignments] = saml_connection_implicit_role_assignments unless saml_connection_implicit_role_assignments.nil?
|
637
659
|
request[:saml_group_implicit_role_assignments] = saml_group_implicit_role_assignments unless saml_group_implicit_role_assignments.nil?
|
638
660
|
request[:alternative_audience_uri] = alternative_audience_uri unless alternative_audience_uri.nil?
|
661
|
+
request[:identity_provider] = identity_provider unless identity_provider.nil?
|
639
662
|
|
640
663
|
put_request("/v1/b2b/sso/saml/#{organization_id}/connections/#{connection_id}", request, headers)
|
641
664
|
end
|
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
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: 8.
|
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
|