google-api-ruby-client icon indicating copy to clipboard operation
google-api-ruby-client copied to clipboard

The response of IdentitytoolkitV3#get_oob_confirmation_code does not include oob_code

Open takatea opened this issue 3 years ago • 1 comments

Environment details

  • OS: macOS Monterey
  • Ruby version: ruby 3.1.3p185
  • Gem name and version:
    • name: google-apis-identitytoolkit_v3
    • version: v0.14.0

Steps to reproduce

Preparation in advance: need to create an authentication user on firebase console (I use email/password as sign-in method.)

  1. Create a Google::Apis::IdentitytoolkitV3::IdentityToolkitService instance
  2. Set the authorization scope to "https://www.googleapis.com/auth/cloud-platform"
  3. Prepare a relying party request using Google::Apis::IdentitytoolkitV3::Relyingparty
  4. Send the request using get_oob_confirmation_code method to send a password reset email
  5. Verify that the oob_code attribute is included in the response

Code example

service = Google::Apis::IdentitytoolkitV3::IdentityToolkitService.new
service.authorization = Google::Auth::ServiceAccountCredentials.make_creds(scope: "https://www.googleapis.com/auth/cloud-platform")

# Email address is a mock value
request = Google::Apis::IdentitytoolkitV3::Relyingparty.new(email: "[email protected]", request_type: "PASSWORD_RESET")
response = service.get_oob_confirmation_code(request)
## => Success, and I recieved an email.

# Verify that the `oob_code` attribute is included in the response
response.oob_code

More detailed description

I executed the code shown in the Code example section above, which sends a password reset email.

I expected the following:

response.oob_code
=> "oob_code sent in the email"

but I actually got:

response.oob_code
=> nil

According to the IdentitytoolkitV3::GetOobConfirmationCodeResponse documentation on RubyDocs, the oob_code attribute seems to be included in the response. However, I am unsure when this attribute is included, and why it is not present in the response I received.

takatea avatar Mar 17 '23 03:03 takatea

Hi @takatea , Thank you for reaching out to us. Github issues are generally to deal with library issues or any feature requests. For library usage questions, I'd recommend to ask this question on StackOverflow's Google Cloud collective which is the most appropriate for general troubleshooting.

I'm going to close this issue for now, but please let us know if there's anything we can do to help!

bajajneha27 avatar Nov 14 '23 08:11 bajajneha27