stytch 7.1.0 → 7.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a3ad4eaf85fcf66b3969d3568488126f9d0d5f77282e454a130aa875753e2046
4
- data.tar.gz: 594aab0fe432b0f5620ec9c62e99d0e5b1f982dfe53d747ed4af36fc90f5fa58
3
+ metadata.gz: bf3ca6839d457c873591f5c06c82af556e23cdbd9d29f8b95536797f373a26fd
4
+ data.tar.gz: 415859fee565a587db32eddf743387d6993166dc020d2e6c1627dbeb435e262d
5
5
  SHA512:
6
- metadata.gz: 34a877bef679e4b601b8debe1e74d60e84034491d398ced07f67d15282ddbe3e86ee740855890d2e3789cbdf1ed72f088933e94e33d4eb11ff89126ab2f40251
7
- data.tar.gz: 3c328b93134b4438a2db4db7030d26eed6b5174ad08465ca1c07d1f5f9d282526ae015d95747a707495fefb8d2304de7de270f7a27fd3854316391c706cb63c7
6
+ metadata.gz: 052f9fc2dca0b0f32014e165fbcac2e96fb5c490095591ce8fe2c561216259bf58b034d6af2c55c7757a91658505664832ce00dedfb6dfa31c5fb8b2f311885a
7
+ data.tar.gz: f9894c9bc3d446a267dd9ff7606d0efb25526e729e94f8479e08f3eab2cfb46afbca2887ef6efb06e5ccd03178eeb9a8f7557916136c861a1acf9e0d5ceba9bc
@@ -41,7 +41,8 @@ module StytchB2B
41
41
  # == Parameters:
42
42
  # intermediate_session_token::
43
43
  # The Intermediate Session Token. This token does not necessarily belong to a specific instance of a Member, but represents a bag of factors that may be converted to a member session.
44
- # The token can be used with the [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms) to complete an MFA flow;
44
+ # The token can be used with the [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms), [TOTP Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-totp),
45
+ # or [Recovery Codes Recover endpoint](https://stytch.com/docs/b2b/api/recovery-codes-recover) to complete an MFA flow;
45
46
  # the [Exchange Intermediate Session endpoint](https://stytch.com/docs/b2b/api/exchange-intermediate-session) to join a specific Organization that allows the factors represented by the intermediate session token;
46
47
  # or the [Create Organization via Discovery endpoint](https://stytch.com/docs/b2b/api/create-organization-via-discovery) to create a new Organization and Member.
47
48
  # The type of this field is +String+.
@@ -102,7 +103,8 @@ module StytchB2B
102
103
  # The type of this field is +Boolean+.
103
104
  # intermediate_session_token::
104
105
  # The returned Intermediate Session Token is identical to the one that was originally passed in to the request.
105
- # The token can be used with the [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms) to complete the MFA flow and log in to the Organization.
106
+ # The token can be used with the [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms), [TOTP Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-totp),
107
+ # or [Recovery Codes Recover endpoint](https://stytch.com/docs/b2b/api/recovery-codes-recover) to complete the MFA flow and log in to the Organization.
106
108
  # It can also be used with the [Exchange Intermediate Session endpoint](https://stytch.com/docs/b2b/api/exchange-intermediate-session) to join a different existing Organization,
107
109
  # or the [Create Organization via Discovery endpoint](https://stytch.com/docs/b2b/api/create-organization-via-discovery) to create a new Organization.
108
110
  # The type of this field is +String+.
@@ -161,7 +163,8 @@ module StytchB2B
161
163
  # == Parameters:
162
164
  # intermediate_session_token::
163
165
  # The Intermediate Session Token. This token does not necessarily belong to a specific instance of a Member, but represents a bag of factors that may be converted to a member session.
164
- # The token can be used with the [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms) to complete an MFA flow;
166
+ # The token can be used with the [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms), [TOTP Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-totp),
167
+ # or [Recovery Codes Recover endpoint](https://stytch.com/docs/b2b/api/recovery-codes-recover) to complete an MFA flow;
165
168
  # the [Exchange Intermediate Session endpoint](https://stytch.com/docs/b2b/api/exchange-intermediate-session) to join a specific Organization that allows the factors represented by the intermediate session token;
166
169
  # or the [Create Organization via Discovery endpoint](https://stytch.com/docs/b2b/api/create-organization-via-discovery) to create a new Organization and Member.
167
170
  # The type of this field is +String+.
@@ -257,15 +260,15 @@ module StytchB2B
257
260
  # for more information about role assignment.
258
261
  # The type of this field is nilable list of +EmailImplicitRoleAssignment+ (+object+).
259
262
  # mfa_methods::
260
- # The setting that controls which mfa methods can be used by Members of an Organization. The accepted values are:
263
+ # The setting that controls which MFA methods can be used by Members of an Organization. The accepted values are:
261
264
  #
262
265
  # `ALL_ALLOWED` – the default setting which allows all authentication methods to be used.
263
266
  #
264
- # `RESTRICTED` – only methods that comply with `allowed_auth_methods` can be used for authentication. This setting does not apply to Members with `is_breakglass` set to `true`.
267
+ # `RESTRICTED` – only methods that comply with `allowed_mfa_methods` can be used for authentication. This setting does not apply to Members with `is_breakglass` set to `true`.
265
268
  #
266
269
  # The type of this field is nilable +String+.
267
270
  # allowed_mfa_methods::
268
- # An array of allowed mfa authentication methods. This list is enforced when `mfa_methods` is set to `RESTRICTED`.
271
+ # An array of allowed MFA authentication methods. This list is enforced when `mfa_methods` is set to `RESTRICTED`.
269
272
  # The list's accepted values are: `sms_otp` and `totp`.
270
273
  #
271
274
  # The type of this field is nilable list of +String+.
@@ -292,7 +295,8 @@ module StytchB2B
292
295
  # The type of this field is +Boolean+.
293
296
  # intermediate_session_token::
294
297
  # The returned Intermediate Session Token is identical to the one that was originally passed in to the request.
295
- # The token can be used with the [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms) to complete the MFA flow and log in to the Organization.
298
+ # The token can be used with the [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms), [TOTP Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-totp),
299
+ # or [Recovery Codes Recover endpoint](https://stytch.com/docs/b2b/api/recovery-codes-recover) to complete the MFA flow and log in to the Organization.
296
300
  # It can also be used with the [Exchange Intermediate Session endpoint](https://stytch.com/docs/b2b/api/exchange-intermediate-session) to join a different existing Organization,
297
301
  # or the [Create Organization via Discovery endpoint](https://stytch.com/docs/b2b/api/create-organization-via-discovery) to create a new Organization.
298
302
  # The type of this field is +String+.
@@ -368,7 +372,8 @@ module StytchB2B
368
372
  # == Parameters:
369
373
  # intermediate_session_token::
370
374
  # The Intermediate Session Token. This token does not necessarily belong to a specific instance of a Member, but represents a bag of factors that may be converted to a member session.
371
- # The token can be used with the [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms) to complete an MFA flow;
375
+ # The token can be used with the [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms), [TOTP Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-totp),
376
+ # or [Recovery Codes Recover endpoint](https://stytch.com/docs/b2b/api/recovery-codes-recover) to complete an MFA flow;
372
377
  # the [Exchange Intermediate Session endpoint](https://stytch.com/docs/b2b/api/exchange-intermediate-session) to join a specific Organization that allows the factors represented by the intermediate session token;
373
378
  # or the [Create Organization via Discovery endpoint](https://stytch.com/docs/b2b/api/create-organization-via-discovery) to create a new Organization and Member.
374
379
  # The type of this field is nilable +String+.
@@ -24,7 +24,8 @@ module StytchB2B
24
24
  # Provide the `session_duration_minutes` parameter to set the lifetime of the session. If the `session_duration_minutes` parameter is not specified, a Stytch session will be created with a 60 minute duration.
25
25
  #
26
26
  # If the Member is required to complete MFA to log in to the Organization, the returned value of `member_authenticated` will be `false`, and an `intermediate_session_token` will be returned.
27
- # The `intermediate_session_token` can be passed into the [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms) to complete the MFA step and acquire a full member session.
27
+ # The `intermediate_session_token` can be passed into the [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms), [TOTP Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-totp),
28
+ # or [Recovery Codes Recover endpoint](https://stytch.com/docs/b2b/api/recovery-codes-recover) to complete the MFA step and acquire a full member session.
28
29
  # The `intermediate_session_token` can also be used with the [Exchange Intermediate Session endpoint](https://stytch.com/docs/b2b/api/exchange-intermediate-session) or the [Create Organization via Discovery endpoint](https://stytch.com/docs/b2b/api/create-organization-via-discovery) to join a different Organization or create a new one.
29
30
  # The `session_duration_minutes` and `session_custom_claims` parameters will be ignored.
30
31
  #
@@ -111,7 +112,8 @@ module StytchB2B
111
112
  # The type of this field is +Organization+ (+object+).
112
113
  # intermediate_session_token::
113
114
  # The returned Intermediate Session Token contains an Email Magic Link factor associated with the Member's email address.
114
- # The token can be used with the [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms) to complete the MFA flow and log in to the Organization.
115
+ # The token can be used with the [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms), [TOTP Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-totp),
116
+ # or [Recovery Codes Recover endpoint](https://stytch.com/docs/b2b/api/recovery-codes-recover) to complete the MFA flow and log in to the Organization.
115
117
  # It can also be used with the [Exchange Intermediate Session endpoint](https://stytch.com/docs/b2b/api/exchange-intermediate-session) to join a different existing Organization that allows login with Email Magic Links,
116
118
  # or the [Create Organization via Discovery endpoint](https://stytch.com/docs/b2b/api/create-organization-via-discovery) to create a new Organization.
117
119
  # The type of this field is +String+.
@@ -424,7 +426,8 @@ module StytchB2B
424
426
  # The type of this field is +String+.
425
427
  # intermediate_session_token::
426
428
  # The Intermediate Session Token. This token does not necessarily belong to a specific instance of a Member, but represents a bag of factors that may be converted to a member session.
427
- # The token can be used with the [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms) to complete an MFA flow;
429
+ # The token can be used with the [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms), [TOTP Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-totp),
430
+ # or [Recovery Codes Recover endpoint](https://stytch.com/docs/b2b/api/recovery-codes-recover) to complete an MFA flow;
428
431
  # the [Exchange Intermediate Session endpoint](https://stytch.com/docs/b2b/api/exchange-intermediate-session) to join a specific Organization that allows the factors represented by the intermediate session token;
429
432
  # or the [Create Organization via Discovery endpoint](https://stytch.com/docs/b2b/api/create-organization-via-discovery) to create a new Organization and Member.
430
433
  # The type of this field is +String+.
@@ -109,7 +109,8 @@ module StytchB2B
109
109
  # The type of this field is +Boolean+.
110
110
  # intermediate_session_token::
111
111
  # The returned Intermediate Session Token contains an OAuth factor associated with the Member's email address.
112
- # The token can be used with the [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms) to complete the MFA flow and log in to the Organization.
112
+ # The token can be used with the [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms), [TOTP Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-totp),
113
+ # or [Recovery Codes Recover endpoint](https://stytch.com/docs/b2b/api/recovery-codes-recover) to complete the MFA flow and log in to the Organization.
113
114
  # It can also be used with the [Exchange Intermediate Session endpoint](https://stytch.com/docs/b2b/api/exchange-intermediate-session) to join a different existing Organization that allows login with OAuth,
114
115
  # or the [Create Organization via Discovery endpoint](https://stytch.com/docs/b2b/api/create-organization-via-discovery) to create a new Organization.
115
116
  # The type of this field is +String+.
@@ -186,7 +187,8 @@ module StytchB2B
186
187
  # The type of this field is +String+.
187
188
  # intermediate_session_token::
188
189
  # The Intermediate Session Token. This token does not necessarily belong to a specific instance of a Member, but represents a bag of factors that may be converted to a member session.
189
- # The token can be used with the [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms) to complete an MFA flow;
190
+ # The token can be used with the [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms), [TOTP Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-totp),
191
+ # or [Recovery Codes Recover endpoint](https://stytch.com/docs/b2b/api/recovery-codes-recover) to complete an MFA flow;
190
192
  # the [Exchange Intermediate Session endpoint](https://stytch.com/docs/b2b/api/exchange-intermediate-session) to join a specific Organization that allows the factors represented by the intermediate session token;
191
193
  # or the [Create Organization via Discovery endpoint](https://stytch.com/docs/b2b/api/create-organization-via-discovery) to create a new Organization and Member.
192
194
  # The type of this field is +String+.
@@ -138,15 +138,15 @@ module StytchB2B
138
138
  # for more information about role assignment.
139
139
  # The type of this field is nilable list of +EmailImplicitRoleAssignment+ (+object+).
140
140
  # mfa_methods::
141
- # The setting that controls which mfa methods can be used by Members of an Organization. The accepted values are:
141
+ # The setting that controls which MFA methods can be used by Members of an Organization. The accepted values are:
142
142
  #
143
143
  # `ALL_ALLOWED` – the default setting which allows all authentication methods to be used.
144
144
  #
145
- # `RESTRICTED` – only methods that comply with `allowed_auth_methods` can be used for authentication. This setting does not apply to Members with `is_breakglass` set to `true`.
145
+ # `RESTRICTED` – only methods that comply with `allowed_mfa_methods` can be used for authentication. This setting does not apply to Members with `is_breakglass` set to `true`.
146
146
  #
147
147
  # The type of this field is nilable +String+.
148
148
  # allowed_mfa_methods::
149
- # An array of allowed mfa authentication methods. This list is enforced when `mfa_methods` is set to `RESTRICTED`.
149
+ # An array of allowed MFA authentication methods. This list is enforced when `mfa_methods` is set to `RESTRICTED`.
150
150
  # The list's accepted values are: `sms_otp` and `totp`.
151
151
  #
152
152
  # The type of this field is nilable list of +String+.
@@ -355,17 +355,17 @@ module StytchB2B
355
355
  # If this field is provided and a session header is passed into the request, the Member Session must have permission to perform the `update.settings.implicit-roles` action on the `stytch.organization` Resource.
356
356
  # The type of this field is nilable list of +String+.
357
357
  # mfa_methods::
358
- # The setting that controls which mfa methods can be used by Members of an Organization. The accepted values are:
358
+ # The setting that controls which MFA methods can be used by Members of an Organization. The accepted values are:
359
359
  #
360
360
  # `ALL_ALLOWED` – the default setting which allows all authentication methods to be used.
361
361
  #
362
- # `RESTRICTED` – only methods that comply with `allowed_auth_methods` can be used for authentication. This setting does not apply to Members with `is_breakglass` set to `true`.
362
+ # `RESTRICTED` – only methods that comply with `allowed_mfa_methods` can be used for authentication. This setting does not apply to Members with `is_breakglass` set to `true`.
363
363
  #
364
364
  #
365
- # If this field is provided and a session header is passed into the request, the Member Session must have permission to perform the `update.settings.allowed-auth-methods` action on the `stytch.organization` Resource.
365
+ # If this field is provided and a session header is passed into the request, the Member Session must have permission to perform the `update.settings.allowed-mfa-methods` action on the `stytch.organization` Resource.
366
366
  # The type of this field is nilable +String+.
367
367
  # allowed_mfa_methods::
368
- # An array of allowed mfa authentication methods. This list is enforced when `mfa_methods` is set to `RESTRICTED`.
368
+ # An array of allowed MFA authentication methods. This list is enforced when `mfa_methods` is set to `RESTRICTED`.
369
369
  # The list's accepted values are: `sms_otp` and `totp`.
370
370
  #
371
371
  #
@@ -502,9 +502,12 @@ module StytchB2B
502
502
 
503
503
  class Members
504
504
  include Stytch::RequestHelper
505
+ attr_reader :oauth_providers
505
506
 
506
507
  def initialize(connection)
507
508
  @connection = connection
509
+
510
+ @oauth_providers = StytchB2B::Organizations::Members::OAuthProviders.new(@connection)
508
511
  end
509
512
 
510
513
  # Updates a Member specified by `organization_id` and `member_id`.
@@ -550,7 +553,7 @@ module StytchB2B
550
553
  # is_breakglass::
551
554
  # Identifies the Member as a break glass user - someone who has permissions to authenticate into an Organization by bypassing the Organization's settings. A break glass account is typically used for emergency purposes to gain access outside of normal authentication procedures. Refer to the [Organization object](organization-object) and its `auth_methods` and `allowed_auth_methods` fields for more details.
552
555
  #
553
- # If this field is provided and a session header is passed into the request, the Member Session must have permission to perform the `update.info.is-breakglass` action on the `stytch.member` Resource.
556
+ # If this field is provided and a session header is passed into the request, the Member Session must have permission to perform the `update.settings.is-breakglass` action on the `stytch.member` Resource.
554
557
  # The type of this field is nilable +Boolean+.
555
558
  # mfa_phone_number::
556
559
  # Sets the Member's phone number. Throws an error if the Member already has a phone number. To change the Member's phone number, use the [Delete member phone number endpoint](https://stytch.com/docs/b2b/api/delete-member-mfa-phone-number) to delete the Member's existing phone number first.
@@ -582,7 +585,10 @@ module StytchB2B
582
585
  # authentication factors with the affected SSO connection IDs will be revoked.
583
586
  # The type of this field is nilable +Boolean+.
584
587
  # default_mfa_method::
585
- # The Member's default MFA method. This value is used to determine which secondary MFA method to use in the case of multiple methods registered for a Member. The current possible values are `sms_otp` and `totp`.
588
+ # Sets whether the Member is enrolled in MFA. If true, the Member must complete an MFA step whenever they wish to log in to their Organization. If false, the Member only needs to complete an MFA step if the Organization's MFA policy is set to `REQUIRED_FOR_ALL`.
589
+ #
590
+ # If this field is provided and a session header is passed into the request, the Member Session must have permission to perform the `update.settings.default-mfa-method` action on the `stytch.member` Resource.
591
+ # Alternatively, if the Member Session matches the Member associated with the `member_id` passed in the request, the authorization check will also allow a Member Session that has permission to perform the `update.settings.default-mfa-method` action on the `stytch.self` Resource.
586
592
  # The type of this field is nilable +String+.
587
593
  #
588
594
  # == Returns:
@@ -1040,6 +1046,114 @@ module StytchB2B
1040
1046
  request = request_with_query_params("/v1/b2b/organizations/#{organization_id}/member", query_params)
1041
1047
  get_request(request, headers)
1042
1048
  end
1049
+
1050
+ class OAuthProviders
1051
+ include Stytch::RequestHelper
1052
+
1053
+ def initialize(connection)
1054
+ @connection = connection
1055
+ end
1056
+
1057
+ # Retrieve the saved Google access token and ID token for a member. After a successful OAuth login, Stytch will save the
1058
+ # issued access token and ID token from the identity provider. If a refresh token has been issued, Stytch will refresh the
1059
+ # access token automatically.
1060
+ #
1061
+ # __Note:__ Google does not issue a refresh token on every login, and refresh tokens may expire if unused.
1062
+ # To force a refresh token to be issued, pass the `?provider_prompt=consent` query param into the
1063
+ # [Start Google OAuth flow](https://stytch.com/docs/b2b/api/oauth-google-start) endpoint.
1064
+ #
1065
+ # == Parameters:
1066
+ # organization_id::
1067
+ # 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.
1068
+ # The type of this field is +String+.
1069
+ # member_id::
1070
+ # 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.
1071
+ # The type of this field is +String+.
1072
+ #
1073
+ # == Returns:
1074
+ # An object with the following fields:
1075
+ # request_id::
1076
+ # 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.
1077
+ # The type of this field is +String+.
1078
+ # provider_type::
1079
+ # Denotes the OAuth identity provider that the user has authenticated with, e.g. Google, Microsoft, GitHub etc.
1080
+ # The type of this field is +String+.
1081
+ # provider_subject::
1082
+ # The unique identifier for the User within a given OAuth provider. Also commonly called the `sub` or "Subject field" in OAuth protocols.
1083
+ # The type of this field is +String+.
1084
+ # access_token::
1085
+ # The `access_token` that you may use to access the User's data in the provider's API.
1086
+ # The type of this field is +String+.
1087
+ # access_token_expires_in::
1088
+ # The number of seconds until the access token expires.
1089
+ # The type of this field is +Integer+.
1090
+ # id_token::
1091
+ # 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.
1092
+ # The type of this field is +String+.
1093
+ # scopes::
1094
+ # The OAuth scopes included for a given provider. See each provider's section above to see which scopes are included by default and how to add custom scopes.
1095
+ # The type of this field is list of +String+.
1096
+ # status_code::
1097
+ # 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.
1098
+ # The type of this field is +Integer+.
1099
+ def google(
1100
+ organization_id:,
1101
+ member_id:
1102
+ )
1103
+ headers = {}
1104
+ query_params = {}
1105
+ request = request_with_query_params("/v1/b2b/organizations/#{organization_id}/members/#{member_id}/oauth_providers/google", query_params)
1106
+ get_request(request, headers)
1107
+ end
1108
+
1109
+ # Retrieve the saved Microsoft access token and ID token for a member. After a successful OAuth login, Stytch will save the
1110
+ # issued access token and ID token from the identity provider. If a refresh token has been issued, Stytch will refresh the
1111
+ # access token automatically.
1112
+ #
1113
+ # == Parameters:
1114
+ # organization_id::
1115
+ # 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.
1116
+ # The type of this field is +String+.
1117
+ # member_id::
1118
+ # 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.
1119
+ # The type of this field is +String+.
1120
+ #
1121
+ # == Returns:
1122
+ # An object with the following fields:
1123
+ # request_id::
1124
+ # 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.
1125
+ # The type of this field is +String+.
1126
+ # provider_type::
1127
+ # Denotes the OAuth identity provider that the user has authenticated with, e.g. Google, Microsoft, GitHub etc.
1128
+ # The type of this field is +String+.
1129
+ # provider_subject::
1130
+ # The unique identifier for the User within a given OAuth provider. Also commonly called the `sub` or "Subject field" in OAuth protocols.
1131
+ # The type of this field is +String+.
1132
+ # access_token::
1133
+ # The `access_token` that you may use to access the User's data in the provider's API.
1134
+ # The type of this field is +String+.
1135
+ # access_token_expires_in::
1136
+ # The number of seconds until the access token expires.
1137
+ # The type of this field is +Integer+.
1138
+ # id_token::
1139
+ # 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.
1140
+ # The type of this field is +String+.
1141
+ # scopes::
1142
+ # The OAuth scopes included for a given provider. See each provider's section above to see which scopes are included by default and how to add custom scopes.
1143
+ # The type of this field is list of +String+.
1144
+ # status_code::
1145
+ # 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.
1146
+ # The type of this field is +Integer+.
1147
+ def microsoft(
1148
+ organization_id:,
1149
+ member_id:
1150
+ )
1151
+ headers = {}
1152
+ query_params = {}
1153
+ request = request_with_query_params("/v1/b2b/organizations/#{organization_id}/members/#{member_id}/oauth_providers/microsoft", query_params)
1154
+ get_request(request, headers)
1155
+ end
1156
+ end
1043
1157
  end
1044
1158
  end
1045
1159
  end
@@ -66,7 +66,8 @@ module StytchB2B
66
66
  # The type of this field is nilable +SendRequestLocale+ (string enum).
67
67
  # intermediate_session_token::
68
68
  # The Intermediate Session Token. This token does not necessarily belong to a specific instance of a Member, but represents a bag of factors that may be converted to a member session.
69
- # The token can be used with the [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms) to complete an MFA flow;
69
+ # The token can be used with the [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms), [TOTP Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-totp),
70
+ # or [Recovery Codes Recover endpoint](https://stytch.com/docs/b2b/api/recovery-codes-recover) to complete an MFA flow;
70
71
  # the [Exchange Intermediate Session endpoint](https://stytch.com/docs/b2b/api/exchange-intermediate-session) to join a specific Organization that allows the factors represented by the intermediate session token;
71
72
  # or the [Create Organization via Discovery endpoint](https://stytch.com/docs/b2b/api/create-organization-via-discovery) to create a new Organization and Member.
72
73
  # The type of this field is nilable +String+.
@@ -146,7 +147,8 @@ module StytchB2B
146
147
  # The type of this field is +String+.
147
148
  # intermediate_session_token::
148
149
  # The Intermediate Session Token. This token does not necessarily belong to a specific instance of a Member, but represents a bag of factors that may be converted to a member session.
149
- # The token can be used with the [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms) to complete an MFA flow;
150
+ # The token can be used with the [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms), [TOTP Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-totp),
151
+ # or [Recovery Codes Recover endpoint](https://stytch.com/docs/b2b/api/recovery-codes-recover) to complete an MFA flow;
150
152
  # the [Exchange Intermediate Session endpoint](https://stytch.com/docs/b2b/api/exchange-intermediate-session) to join a specific Organization that allows the factors represented by the intermediate session token;
151
153
  # or the [Create Organization via Discovery endpoint](https://stytch.com/docs/b2b/api/create-organization-via-discovery) to create a new Organization and Member.
152
154
  # The type of this field is nilable +String+.
@@ -281,7 +281,8 @@ module StytchB2B
281
281
  # The type of this field is +Organization+ (+object+).
282
282
  # intermediate_session_token::
283
283
  # The returned Intermediate Session Token contains a password factor associated with the Member.
284
- # The token can be used with the [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms) to complete the MFA flow and log in to the Organization.
284
+ # The token can be used with the [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms), [TOTP Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-totp),
285
+ # or [Recovery Codes Recover endpoint](https://stytch.com/docs/b2b/api/recovery-codes-recover) to complete the MFA flow and log in to the Organization.
285
286
  # Password factors are not transferable between Organizations, so the intermediate session token is not valid for use with discovery endpoints.
286
287
  # The type of this field is +String+.
287
288
  # member_authenticated::
@@ -501,7 +502,8 @@ module StytchB2B
501
502
  # The type of this field is +Organization+ (+object+).
502
503
  # intermediate_session_token::
503
504
  # The returned Intermediate Session Token contains a password factor associated with the Member.
504
- # The token can be used with the [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms) to complete the MFA flow and log in to the Organization.
505
+ # The token can be used with the [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms), [TOTP Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-totp),
506
+ # or [Recovery Codes Recover endpoint](https://stytch.com/docs/b2b/api/recovery-codes-recover) to complete the MFA flow and log in to the Organization.
505
507
  # Password factors are not transferable between Organizations, so the intermediate session token is not valid for use with discovery endpoints.
506
508
  # The type of this field is +String+.
507
509
  # member_authenticated::
@@ -613,7 +615,8 @@ module StytchB2B
613
615
  # The type of this field is +String+.
614
616
  # intermediate_session_token::
615
617
  # The Intermediate Session Token. This token does not necessarily belong to a specific instance of a Member, but represents a bag of factors that may be converted to a member session.
616
- # The token can be used with the [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms) to complete an MFA flow;
618
+ # The token can be used with the [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms), [TOTP Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-totp),
619
+ # or [Recovery Codes Recover endpoint](https://stytch.com/docs/b2b/api/recovery-codes-recover) to complete an MFA flow;
617
620
  # the [Exchange Intermediate Session endpoint](https://stytch.com/docs/b2b/api/exchange-intermediate-session) to join a specific Organization that allows the factors represented by the intermediate session token;
618
621
  # or the [Create Organization via Discovery endpoint](https://stytch.com/docs/b2b/api/create-organization-via-discovery) to create a new Organization and Member.
619
622
  # The type of this field is +String+.
@@ -744,7 +747,8 @@ module StytchB2B
744
747
  # The type of this field is +Organization+ (+object+).
745
748
  # intermediate_session_token::
746
749
  # The returned Intermediate Session Token contains a password factor associated with the Member.
747
- # The token can be used with the [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms) to complete the MFA flow and log in to the Organization.
750
+ # The token can be used with the [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms), [TOTP Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-totp),
751
+ # or [Recovery Codes Recover endpoint](https://stytch.com/docs/b2b/api/recovery-codes-recover) to complete the MFA flow and log in to the Organization.
748
752
  # Password factors are not transferable between Organizations, so the intermediate session token is not valid for use with discovery endpoints.
749
753
  # The type of this field is +String+.
750
754
  # member_authenticated::
@@ -18,10 +18,9 @@ module StytchB2B
18
18
 
19
19
  # Get the active RBAC Policy for your current Stytch Project. An RBAC Policy is the canonical document that stores all defined Resources and Roles within your RBAC permissioning model.
20
20
  #
21
- # When using the backend SDKs, the RBAC Policy will automatically be loaded and refreshed in the background to allow for local evaluations, eliminating the need for an extra request to Stytch.
22
- #
23
- # Resources and Roles can be created and managed within the [Dashboard](/dashboard). Additionally, [Role assignment](https://stytch.com/docs/b2b/guides/rbac/role-assignment) can be programmatically managed through certain Stytch API endpoints.
21
+ # When using the backend SDKs, the RBAC Policy will be cached to allow for local evaluations, eliminating the need for an extra request to Stytch. The policy will be refreshed if an authorization check is requested and the RBAC policy was last updated more than 5 minutes ago.
24
22
  #
23
+ # Resources and Roles can be created and managed within the [Dashboard](/dashboard/rbac). Additionally, [Role assignment](https://stytch.com/docs/b2b/guides/rbac/role-assignment) can be programmatically managed through certain Stytch API endpoints.
25
24
  #
26
25
  # Check out the [RBAC overview](https://stytch.com/docs/b2b/guides/rbac/overview) to learn more about Stytch's RBAC permissioning model.
27
26
  #
@@ -36,7 +35,7 @@ module StytchB2B
36
35
  # 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.
37
36
  # The type of this field is +Integer+.
38
37
  # policy::
39
- # The RBAC Policy document that contains all defined Roles and Resources – which are managed in the [Dashboard](/dashboard). Read more about these entities and how they work in our [RBAC overview](https://stytch.com/docs/b2b/guides/rbac/overview).
38
+ # The RBAC Policy document that contains all defined Roles and Resources – which are managed in the [Dashboard](/dashboard/rbac). Read more about these entities and how they work in our [RBAC overview](https://stytch.com/docs/b2b/guides/rbac/overview).
40
39
  # The type of this field is nilable +Policy+ (+object+).
41
40
  def policy
42
41
  headers = {}
@@ -30,7 +30,8 @@ module StytchB2B
30
30
  # The type of this field is +String+.
31
31
  # intermediate_session_token::
32
32
  # The Intermediate Session Token. This token does not necessarily belong to a specific instance of a Member, but represents a bag of factors that may be converted to a member session.
33
- # The token can be used with the [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms) to complete an MFA flow;
33
+ # The token can be used with the [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms), [TOTP Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-totp),
34
+ # or [Recovery Codes Recover endpoint](https://stytch.com/docs/b2b/api/recovery-codes-recover) to complete an MFA flow;
34
35
  # the [Exchange Intermediate Session endpoint](https://stytch.com/docs/b2b/api/exchange-intermediate-session) to join a specific Organization that allows the factors represented by the intermediate session token;
35
36
  # or the [Create Organization via Discovery endpoint](https://stytch.com/docs/b2b/api/create-organization-via-discovery) to create a new Organization and Member.
36
37
  # The type of this field is nilable +String+.
@@ -284,7 +284,8 @@ module StytchB2B
284
284
  # The type of this field is +Boolean+.
285
285
  # intermediate_session_token::
286
286
  # The returned Intermediate Session Token contains any Email Magic Link or OAuth factors from the original member session that are valid for the target Organization.
287
- # The token can be used with the [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms) to complete the MFA flow and log in to the target Organization.
287
+ # The token can be used with the [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms), [TOTP Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-totp),
288
+ # or [Recovery Codes Recover endpoint](https://stytch.com/docs/b2b/api/recovery-codes-recover) to complete the MFA flow and log in to the target Organization.
288
289
  # It can also be used with the [Exchange Intermediate Session endpoint](https://stytch.com/docs/b2b/api/exchange-intermediate-session) to join a different existing Organization,
289
290
  # or the [Create Organization via Discovery endpoint](https://stytch.com/docs/b2b/api/create-organization-via-discovery) to create a new Organization.
290
291
  # The type of this field is +String+.
@@ -134,7 +134,8 @@ module StytchB2B
134
134
  # To link this authentication event to an existing Stytch session, include either the `session_token` or `session_jwt` param.
135
135
  #
136
136
  # If the Member is required to complete MFA to log in to the Organization, the returned value of `member_authenticated` will be `false`, and an `intermediate_session_token` will be returned.
137
- # The `intermediate_session_token` can be passed into the [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms) to complete the MFA step and acquire a full member session.
137
+ # The `intermediate_session_token` can be passed into the [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms), [TOTP Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-totp),
138
+ # or [Recovery Codes Recover endpoint](https://stytch.com/docs/b2b/api/recovery-codes-recover) to complete the MFA step and acquire a full member session.
138
139
  # The `session_duration_minutes` and `session_custom_claims` parameters will be ignored.
139
140
  #
140
141
  # If a valid `session_token` or `session_jwt` is passed in, the Member will not be required to complete an MFA step.
@@ -210,7 +211,8 @@ module StytchB2B
210
211
  # The type of this field is +Organization+ (+object+).
211
212
  # intermediate_session_token::
212
213
  # The returned Intermediate Session Token contains an SSO factor associated with the Member.
213
- # The token can be used with the [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms) to complete the MFA flow and log in to the Organization.
214
+ # The token can be used with the [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms), [TOTP Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-totp),
215
+ # or [Recovery Codes Recover endpoint](https://stytch.com/docs/b2b/api/recovery-codes-recover) to complete the MFA flow and log in to the Organization.
214
216
  # SSO factors are not transferable between Organizations, so the intermediate session token is not valid for use with discovery endpoints.
215
217
  # The type of this field is +String+.
216
218
  # member_authenticated::
@@ -32,7 +32,8 @@ module StytchB2B
32
32
  # The type of this field is nilable +Integer+.
33
33
  # intermediate_session_token::
34
34
  # The Intermediate Session Token. This token does not necessarily belong to a specific instance of a Member, but represents a bag of factors that may be converted to a member session.
35
- # The token can be used with the [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms) to complete an MFA flow;
35
+ # The token can be used with the [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms), [TOTP Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-totp),
36
+ # or [Recovery Codes Recover endpoint](https://stytch.com/docs/b2b/api/recovery-codes-recover) to complete an MFA flow;
36
37
  # the [Exchange Intermediate Session endpoint](https://stytch.com/docs/b2b/api/exchange-intermediate-session) to join a specific Organization that allows the factors represented by the intermediate session token;
37
38
  # or the [Create Organization via Discovery endpoint](https://stytch.com/docs/b2b/api/create-organization-via-discovery) to create a new Organization and Member.
38
39
  # The type of this field is nilable +String+.
@@ -107,7 +108,8 @@ module StytchB2B
107
108
  # The type of this field is +String+.
108
109
  # intermediate_session_token::
109
110
  # The Intermediate Session Token. This token does not necessarily belong to a specific instance of a Member, but represents a bag of factors that may be converted to a member session.
110
- # The token can be used with the [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms) to complete an MFA flow;
111
+ # The token can be used with the [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms), [TOTP Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-totp),
112
+ # or [Recovery Codes Recover endpoint](https://stytch.com/docs/b2b/api/recovery-codes-recover) to complete an MFA flow;
111
113
  # the [Exchange Intermediate Session endpoint](https://stytch.com/docs/b2b/api/exchange-intermediate-session) to join a specific Organization that allows the factors represented by the intermediate session token;
112
114
  # or the [Create Organization via Discovery endpoint](https://stytch.com/docs/b2b/api/create-organization-via-discovery) to create a new Organization and Member.
113
115
  # The type of this field is nilable +String+.
data/lib/stytch/otps.rb CHANGED
@@ -455,7 +455,7 @@ module Stytch
455
455
  # This endpoint also allows you to add a new email address to an existing Stytch User. Including a `user_id`, `session_token`, or `session_jwt` in your Send one-time passcode by email request will add the new, unverified email address to the existing Stytch User. If the user successfully authenticates within 5 minutes, the new email address will be marked as verified and remain permanently on the existing Stytch User. Otherwise, it will be removed from the User object, and any subsequent login requests using that email address will create a new User.
456
456
  #
457
457
  # ### Next steps
458
- # Collect the OTP which was delivered to the user. Call [Authenticate OTP](https://stytch.com/docs/api/authenticate-otp) using the OTP `code` along with the `phone_id` found in the response as the `method_id`.
458
+ # Collect the OTP which was delivered to the user. Call [Authenticate OTP](https://stytch.com/docs/api/authenticate-otp) using the OTP `code` along with the `email_id` found in the response as the `method_id`.
459
459
  #
460
460
  # == Parameters:
461
461
  # email::
@@ -292,6 +292,11 @@ module Stytch
292
292
  # untrusted_metadata::
293
293
  # The `untrusted_metadata` field contains an arbitrary JSON object of application-specific data. Untrusted metadata can be edited by end users directly via the SDK, and **cannot be used to store critical information.** See the [Metadata](https://stytch.com/docs/api/metadata) reference for complete field behavior details.
294
294
  # The type of this field is nilable +object+.
295
+ # set_email_verified::
296
+ # Whether to set the user's email as verified. This is a dangerous field. Incorrect use may lead to users getting erroneously
297
+ # deduplicated into one user object. This flag should only be set if you can attest that the user owns the email address in question.
298
+ # Access to this field is restricted. To enable it, please send us a note at support@stytch.com.
299
+ # The type of this field is nilable +Boolean+.
295
300
  # name::
296
301
  # The name of the user. Each field in the name object is optional.
297
302
  # The type of this field is nilable +Name+ (+object+).
@@ -327,6 +332,7 @@ module Stytch
327
332
  pbkdf_2_config: nil,
328
333
  trusted_metadata: nil,
329
334
  untrusted_metadata: nil,
335
+ set_email_verified: nil,
330
336
  name: nil
331
337
  )
332
338
  headers = {}
@@ -342,6 +348,7 @@ module Stytch
342
348
  request[:pbkdf_2_config] = pbkdf_2_config unless pbkdf_2_config.nil?
343
349
  request[:trusted_metadata] = trusted_metadata unless trusted_metadata.nil?
344
350
  request[:untrusted_metadata] = untrusted_metadata unless untrusted_metadata.nil?
351
+ request[:set_email_verified] = set_email_verified unless set_email_verified.nil?
345
352
  request[:name] = name unless name.nil?
346
353
 
347
354
  post_request('/v1/passwords/migrate', request, headers)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Stytch
4
- VERSION = '7.1.0'
4
+ VERSION = '7.3.0'
5
5
  end
@@ -291,7 +291,7 @@ module Stytch
291
291
  #
292
292
  # == Parameters:
293
293
  # webauthn_registration_id::
294
- # Globally unique UUID that identifies a Passkey or WebAuthn registration in the Stytch API. The `webautn_registration_id` is used when you need to operate on a specific User's WebAuthn registartion.
294
+ # Globally unique UUID that identifies a Passkey or WebAuthn registration in the Stytch API. The `webauthn_registration_id` is used when you need to operate on a specific User's WebAuthn registration.
295
295
  # The type of this field is +String+.
296
296
  # name::
297
297
  # The `name` of the WebAuthn registration or Passkey.
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: 7.1.0
4
+ version: 7.3.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-01-23 00:00:00.000000000 Z
11
+ date: 2024-03-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday