From 63c4c217fbc3b33d2423bbd75d66abfd00acf6ed Mon Sep 17 00:00:00 2001 From: Max Gerber <89937743+max-stytch@users.noreply.github.com> Date: Mon, 4 Mar 2024 11:46:28 -0800 Subject: [PATCH] chore: [AUTH-2594] Publish Member OAuth methods (#115) * chore: [AUTH-2594] Publish Member OAuth methods * version * rubocop --- lib/stytch/b2b_discovery.rb | 15 ++-- lib/stytch/b2b_magic_links.rb | 9 ++- lib/stytch/b2b_oauth.rb | 6 +- lib/stytch/b2b_organizations.rb | 116 ++++++++++++++++++++++++++++++- lib/stytch/b2b_otp.rb | 6 +- lib/stytch/b2b_passwords.rb | 12 ++-- lib/stytch/b2b_recovery_codes.rb | 3 +- lib/stytch/b2b_sessions.rb | 3 +- lib/stytch/b2b_sso.rb | 6 +- lib/stytch/b2b_totps.rb | 6 +- lib/stytch/otps.rb | 2 +- lib/stytch/version.rb | 2 +- lib/stytch/webauthn.rb | 2 +- 13 files changed, 162 insertions(+), 26 deletions(-) diff --git a/lib/stytch/b2b_discovery.rb b/lib/stytch/b2b_discovery.rb index 0739d81..9103ea5 100644 --- a/lib/stytch/b2b_discovery.rb +++ b/lib/stytch/b2b_discovery.rb @@ -41,7 +41,8 @@ def initialize(connection) # == Parameters: # intermediate_session_token:: # 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. - # 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; + # 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), + # or [Recovery Codes Recover endpoint](https://stytch.com/docs/b2b/api/recovery-codes-recover) to complete an MFA flow; # 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; # or the [Create Organization via Discovery endpoint](https://stytch.com/docs/b2b/api/create-organization-via-discovery) to create a new Organization and Member. # The type of this field is +String+. @@ -102,7 +103,8 @@ def initialize(connection) # The type of this field is +Boolean+. # intermediate_session_token:: # The returned Intermediate Session Token is identical to the one that was originally passed in to the request. - # 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. + # 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), + # 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. # 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, # or the [Create Organization via Discovery endpoint](https://stytch.com/docs/b2b/api/create-organization-via-discovery) to create a new Organization. # The type of this field is +String+. @@ -161,7 +163,8 @@ def initialize(connection) # == Parameters: # intermediate_session_token:: # 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. - # 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; + # 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), + # or [Recovery Codes Recover endpoint](https://stytch.com/docs/b2b/api/recovery-codes-recover) to complete an MFA flow; # 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; # or the [Create Organization via Discovery endpoint](https://stytch.com/docs/b2b/api/create-organization-via-discovery) to create a new Organization and Member. # The type of this field is +String+. @@ -292,7 +295,8 @@ def initialize(connection) # The type of this field is +Boolean+. # intermediate_session_token:: # The returned Intermediate Session Token is identical to the one that was originally passed in to the request. - # 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. + # 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), + # 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. # 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, # or the [Create Organization via Discovery endpoint](https://stytch.com/docs/b2b/api/create-organization-via-discovery) to create a new Organization. # The type of this field is +String+. @@ -368,7 +372,8 @@ def create( # == Parameters: # intermediate_session_token:: # 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. - # 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; + # 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), + # or [Recovery Codes Recover endpoint](https://stytch.com/docs/b2b/api/recovery-codes-recover) to complete an MFA flow; # 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; # or the [Create Organization via Discovery endpoint](https://stytch.com/docs/b2b/api/create-organization-via-discovery) to create a new Organization and Member. # The type of this field is nilable +String+. diff --git a/lib/stytch/b2b_magic_links.rb b/lib/stytch/b2b_magic_links.rb index 64e2f57..9e30050 100644 --- a/lib/stytch/b2b_magic_links.rb +++ b/lib/stytch/b2b_magic_links.rb @@ -24,7 +24,8 @@ def initialize(connection) # 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. # # 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. - # 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. + # 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), + # 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. # 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. # The `session_duration_minutes` and `session_custom_claims` parameters will be ignored. # @@ -111,7 +112,8 @@ def initialize(connection) # The type of this field is +Organization+ (+object+). # intermediate_session_token:: # The returned Intermediate Session Token contains an Email Magic Link factor associated with the Member's email address. - # 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. + # 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), + # 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. # 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, # or the [Create Organization via Discovery endpoint](https://stytch.com/docs/b2b/api/create-organization-via-discovery) to create a new Organization. # The type of this field is +String+. @@ -424,7 +426,8 @@ def initialize(connection) # The type of this field is +String+. # intermediate_session_token:: # 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. - # 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; + # 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), + # or [Recovery Codes Recover endpoint](https://stytch.com/docs/b2b/api/recovery-codes-recover) to complete an MFA flow; # 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; # or the [Create Organization via Discovery endpoint](https://stytch.com/docs/b2b/api/create-organization-via-discovery) to create a new Organization and Member. # The type of this field is +String+. diff --git a/lib/stytch/b2b_oauth.rb b/lib/stytch/b2b_oauth.rb index 56fe7b2..8963bb5 100644 --- a/lib/stytch/b2b_oauth.rb +++ b/lib/stytch/b2b_oauth.rb @@ -109,7 +109,8 @@ def initialize(connection) # The type of this field is +Boolean+. # intermediate_session_token:: # The returned Intermediate Session Token contains an OAuth factor associated with the Member's email address. - # 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. + # 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), + # 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. # 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, # or the [Create Organization via Discovery endpoint](https://stytch.com/docs/b2b/api/create-organization-via-discovery) to create a new Organization. # The type of this field is +String+. @@ -186,7 +187,8 @@ def initialize(connection) # The type of this field is +String+. # intermediate_session_token:: # 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. - # 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; + # 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), + # or [Recovery Codes Recover endpoint](https://stytch.com/docs/b2b/api/recovery-codes-recover) to complete an MFA flow; # 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; # or the [Create Organization via Discovery endpoint](https://stytch.com/docs/b2b/api/create-organization-via-discovery) to create a new Organization and Member. # The type of this field is +String+. diff --git a/lib/stytch/b2b_organizations.rb b/lib/stytch/b2b_organizations.rb index 6783976..ccd6601 100644 --- a/lib/stytch/b2b_organizations.rb +++ b/lib/stytch/b2b_organizations.rb @@ -502,9 +502,12 @@ def search( class Members include Stytch::RequestHelper + attr_reader :oauth_providers def initialize(connection) @connection = connection + + @oauth_providers = StytchB2B::Organizations::Members::OAuthProviders.new(@connection) end # Updates a Member specified by `organization_id` and `member_id`. @@ -582,7 +585,10 @@ def initialize(connection) # authentication factors with the affected SSO connection IDs will be revoked. # The type of this field is nilable +Boolean+. # default_mfa_method:: - # 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`. + # 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`. + # + # 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. + # 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. # The type of this field is nilable +String+. # # == Returns: @@ -1040,6 +1046,114 @@ def get( request = request_with_query_params("/v1/b2b/organizations/#{organization_id}/member", query_params) get_request(request, headers) end + + class OAuthProviders + include Stytch::RequestHelper + + def initialize(connection) + @connection = connection + end + + # Retrieve the saved Google access token and ID token for a member. After a successful OAuth login, Stytch will save the + # issued access token and ID token from the identity provider. If a refresh token has been issued, Stytch will refresh the + # access token automatically. + # + # __Note:__ Google does not issue a refresh token on every login, and refresh tokens may expire if unused. + # To force a refresh token to be issued, pass the `?provider_prompt=consent` query param into the + # [Start Google OAuth flow](https://stytch.com/docs/b2b/api/oauth-google-start) endpoint. + # + # == Parameters: + # organization_id:: + # 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. + # The type of this field is +String+. + # member_id:: + # 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. + # The type of this field is +String+. + # + # == Returns: + # An object with the following fields: + # request_id:: + # 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. + # The type of this field is +String+. + # provider_type:: + # Denotes the OAuth identity provider that the user has authenticated with, e.g. Google, Microsoft, GitHub etc. + # The type of this field is +String+. + # provider_subject:: + # The unique identifier for the User within a given OAuth provider. Also commonly called the `sub` or "Subject field" in OAuth protocols. + # The type of this field is +String+. + # access_token:: + # The `access_token` that you may use to access the User's data in the provider's API. + # The type of this field is +String+. + # access_token_expires_in:: + # The number of seconds until the access token expires. + # The type of this field is +Integer+. + # id_token:: + # 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. + # The type of this field is +String+. + # scopes:: + # 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. + # The type of this field is list of +String+. + # status_code:: + # 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. + # The type of this field is +Integer+. + def google( + organization_id:, + member_id: + ) + headers = {} + query_params = {} + request = request_with_query_params("/v1/b2b/organizations/#{organization_id}/members/#{member_id}/oauth_providers/google", query_params) + get_request(request, headers) + end + + # Retrieve the saved Microsoft access token and ID token for a member. After a successful OAuth login, Stytch will save the + # issued access token and ID token from the identity provider. If a refresh token has been issued, Stytch will refresh the + # access token automatically. + # + # == Parameters: + # organization_id:: + # 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. + # The type of this field is +String+. + # member_id:: + # 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. + # The type of this field is +String+. + # + # == Returns: + # An object with the following fields: + # request_id:: + # 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. + # The type of this field is +String+. + # provider_type:: + # Denotes the OAuth identity provider that the user has authenticated with, e.g. Google, Microsoft, GitHub etc. + # The type of this field is +String+. + # provider_subject:: + # The unique identifier for the User within a given OAuth provider. Also commonly called the `sub` or "Subject field" in OAuth protocols. + # The type of this field is +String+. + # access_token:: + # The `access_token` that you may use to access the User's data in the provider's API. + # The type of this field is +String+. + # access_token_expires_in:: + # The number of seconds until the access token expires. + # The type of this field is +Integer+. + # id_token:: + # 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. + # The type of this field is +String+. + # scopes:: + # 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. + # The type of this field is list of +String+. + # status_code:: + # 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. + # The type of this field is +Integer+. + def microsoft( + organization_id:, + member_id: + ) + headers = {} + query_params = {} + request = request_with_query_params("/v1/b2b/organizations/#{organization_id}/members/#{member_id}/oauth_providers/microsoft", query_params) + get_request(request, headers) + end + end end end end diff --git a/lib/stytch/b2b_otp.rb b/lib/stytch/b2b_otp.rb index c1f832d..718ffe8 100644 --- a/lib/stytch/b2b_otp.rb +++ b/lib/stytch/b2b_otp.rb @@ -66,7 +66,8 @@ def initialize(connection) # The type of this field is nilable +SendRequestLocale+ (string enum). # intermediate_session_token:: # 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. - # 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; + # 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), + # or [Recovery Codes Recover endpoint](https://stytch.com/docs/b2b/api/recovery-codes-recover) to complete an MFA flow; # 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; # or the [Create Organization via Discovery endpoint](https://stytch.com/docs/b2b/api/create-organization-via-discovery) to create a new Organization and Member. # The type of this field is nilable +String+. @@ -146,7 +147,8 @@ def send( # The type of this field is +String+. # intermediate_session_token:: # 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. - # 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; + # 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), + # or [Recovery Codes Recover endpoint](https://stytch.com/docs/b2b/api/recovery-codes-recover) to complete an MFA flow; # 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; # or the [Create Organization via Discovery endpoint](https://stytch.com/docs/b2b/api/create-organization-via-discovery) to create a new Organization and Member. # The type of this field is nilable +String+. diff --git a/lib/stytch/b2b_passwords.rb b/lib/stytch/b2b_passwords.rb index 46cc25b..7bde8ad 100644 --- a/lib/stytch/b2b_passwords.rb +++ b/lib/stytch/b2b_passwords.rb @@ -281,7 +281,8 @@ def migrate( # The type of this field is +Organization+ (+object+). # intermediate_session_token:: # The returned Intermediate Session Token contains a password factor associated with the Member. - # 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. + # 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), + # 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. # Password factors are not transferable between Organizations, so the intermediate session token is not valid for use with discovery endpoints. # The type of this field is +String+. # member_authenticated:: @@ -501,7 +502,8 @@ def reset_start( # The type of this field is +Organization+ (+object+). # intermediate_session_token:: # The returned Intermediate Session Token contains a password factor associated with the Member. - # 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. + # 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), + # 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. # Password factors are not transferable between Organizations, so the intermediate session token is not valid for use with discovery endpoints. # The type of this field is +String+. # member_authenticated:: @@ -613,7 +615,8 @@ def initialize(connection) # The type of this field is +String+. # intermediate_session_token:: # 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. - # 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; + # 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), + # or [Recovery Codes Recover endpoint](https://stytch.com/docs/b2b/api/recovery-codes-recover) to complete an MFA flow; # 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; # or the [Create Organization via Discovery endpoint](https://stytch.com/docs/b2b/api/create-organization-via-discovery) to create a new Organization and Member. # The type of this field is +String+. @@ -744,7 +747,8 @@ def initialize(connection) # The type of this field is +Organization+ (+object+). # intermediate_session_token:: # The returned Intermediate Session Token contains a password factor associated with the Member. - # 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. + # 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), + # 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. # Password factors are not transferable between Organizations, so the intermediate session token is not valid for use with discovery endpoints. # The type of this field is +String+. # member_authenticated:: diff --git a/lib/stytch/b2b_recovery_codes.rb b/lib/stytch/b2b_recovery_codes.rb index 1f8751a..da213c1 100644 --- a/lib/stytch/b2b_recovery_codes.rb +++ b/lib/stytch/b2b_recovery_codes.rb @@ -30,7 +30,8 @@ def initialize(connection) # The type of this field is +String+. # intermediate_session_token:: # 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. - # 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; + # 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), + # or [Recovery Codes Recover endpoint](https://stytch.com/docs/b2b/api/recovery-codes-recover) to complete an MFA flow; # 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; # or the [Create Organization via Discovery endpoint](https://stytch.com/docs/b2b/api/create-organization-via-discovery) to create a new Organization and Member. # The type of this field is nilable +String+. diff --git a/lib/stytch/b2b_sessions.rb b/lib/stytch/b2b_sessions.rb index 2ab1405..f5ae9da 100644 --- a/lib/stytch/b2b_sessions.rb +++ b/lib/stytch/b2b_sessions.rb @@ -284,7 +284,8 @@ def revoke( # The type of this field is +Boolean+. # intermediate_session_token:: # 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. - # 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. + # 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), + # 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. # 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, # or the [Create Organization via Discovery endpoint](https://stytch.com/docs/b2b/api/create-organization-via-discovery) to create a new Organization. # The type of this field is +String+. diff --git a/lib/stytch/b2b_sso.rb b/lib/stytch/b2b_sso.rb index 467eed5..564b487 100644 --- a/lib/stytch/b2b_sso.rb +++ b/lib/stytch/b2b_sso.rb @@ -134,7 +134,8 @@ def delete_connection( # To link this authentication event to an existing Stytch session, include either the `session_token` or `session_jwt` param. # # 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. - # 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. + # 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), + # 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. # The `session_duration_minutes` and `session_custom_claims` parameters will be ignored. # # 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 @@ def delete_connection( # The type of this field is +Organization+ (+object+). # intermediate_session_token:: # The returned Intermediate Session Token contains an SSO factor associated with the Member. - # 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. + # 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), + # 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. # SSO factors are not transferable between Organizations, so the intermediate session token is not valid for use with discovery endpoints. # The type of this field is +String+. # member_authenticated:: diff --git a/lib/stytch/b2b_totps.rb b/lib/stytch/b2b_totps.rb index e67a6f3..e7298c2 100644 --- a/lib/stytch/b2b_totps.rb +++ b/lib/stytch/b2b_totps.rb @@ -32,7 +32,8 @@ def initialize(connection) # The type of this field is nilable +Integer+. # intermediate_session_token:: # 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. - # 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; + # 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), + # or [Recovery Codes Recover endpoint](https://stytch.com/docs/b2b/api/recovery-codes-recover) to complete an MFA flow; # 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; # or the [Create Organization via Discovery endpoint](https://stytch.com/docs/b2b/api/create-organization-via-discovery) to create a new Organization and Member. # The type of this field is nilable +String+. @@ -107,7 +108,8 @@ def create( # The type of this field is +String+. # intermediate_session_token:: # 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. - # 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; + # 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), + # or [Recovery Codes Recover endpoint](https://stytch.com/docs/b2b/api/recovery-codes-recover) to complete an MFA flow; # 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; # or the [Create Organization via Discovery endpoint](https://stytch.com/docs/b2b/api/create-organization-via-discovery) to create a new Organization and Member. # The type of this field is nilable +String+. diff --git a/lib/stytch/otps.rb b/lib/stytch/otps.rb index 9586e16..6b3bd29 100644 --- a/lib/stytch/otps.rb +++ b/lib/stytch/otps.rb @@ -455,7 +455,7 @@ def initialize(connection) # 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. # # ### Next steps - # 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`. + # 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`. # # == Parameters: # email:: diff --git a/lib/stytch/version.rb b/lib/stytch/version.rb index 14438c5..29086a3 100644 --- a/lib/stytch/version.rb +++ b/lib/stytch/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Stytch - VERSION = '7.2.0' + VERSION = '7.3.0' end diff --git a/lib/stytch/webauthn.rb b/lib/stytch/webauthn.rb index 869c0b9..128a07b 100644 --- a/lib/stytch/webauthn.rb +++ b/lib/stytch/webauthn.rb @@ -291,7 +291,7 @@ def authenticate( # # == Parameters: # webauthn_registration_id:: - # 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. + # 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. # The type of this field is +String+. # name:: # The `name` of the WebAuthn registration or Passkey.