Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

createAPIKey(named: String) returns named func param value instead of actual API key #8021

Closed
matthewmorek opened this issue Nov 7, 2022 · 1 comment · Fixed by #8022
Closed

Comments

@matthewmorek
Copy link

matthewmorek commented Nov 7, 2022

How frequently does the bug occur?

All the time

Description

When a user signs in, I'm trying to create and securely store a UserAPIKey in Keychain, so I could sign in on their behalf from within an iOS App Extension. However, when running user.createAPIKey(named:) method for creating an API key via SDK, I do get an unexpected return value.

The result should be a proper API key string, not the value of named argument in function signature.

I delete keys after running user.logOut() function each time.

Stacktrace & log output

Atlas event log shows that the API key has been successfully created every time.

OK | Nov 07 16:20:35+00:00 | 28ms | API Key

Can you reproduce the bug?

Yes, always

Reproduction Steps

let user = try await app.login(credentials: Credentials.emailPassword(email: email, password: password))
let apiKey = try await user.apiKeysAuth.createAPIKey(named: "iOSApiKey")
print("KEY: \(apiKey.key)")
// KEY: Optional("iOSApiKey")

Version

10.32.2

What SDK flavour are you using?

MongoDB Realm (i.e. Sync, auth, functions)

Are you using encryption?

No, not using encryption

Platform OS and version(s)

iOS 16.1 Simulator (macOS 12.6.1)

Build environment

ProductName:	macOS
ProductVersion:	12.6.1
BuildVersion:	21G217

/Applications/Xcode.app/Contents/Developer
Xcode 14.1
Build version 14B47b

/opt/homebrew/bin/pod
1.11.3
(not in use here)

/bin/bash
GNU bash, version 3.2.57(1)-release (arm64-apple-darwin21)

carthage not found
(not in use here)

/usr/bin/git
git version 2.37.1 (Apple Git-137.1)
@leemaguire
Copy link
Contributor

Hi @matthewmorek I'm taking a look into this now.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants