-
Notifications
You must be signed in to change notification settings - Fork 125
Implement UseUserAccessGroup for Firebase Auth C++ SDK #1757
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
Changes from 1 commit
41eb0e2
c8f87a3
c380f02
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -517,6 +517,21 @@ class Auth { | |
/// not available on the current device. | ||
static Auth* GetAuth(App* app, InitResult* init_result_out = nullptr); | ||
|
||
/// @brief Specifies a user access group for iCloud keychain access. | ||
/// | ||
/// This method is only functional on iOS. On other platforms, it is a no-op | ||
/// and will always return `kAuthErrorNone`. | ||
/// | ||
/// If you are using iCloud keychain synchronization, you will need to call | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove this sentence. |
||
/// this method to set the user access group. | ||
/// | ||
/// @param[in] access_group The user access group to use. Set to `nullptr` or | ||
/// an empty string to use the default access group. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's pass in an empty string verbatim instead of treating it as nil. |
||
/// | ||
/// @return `kAuthErrorNone` on success, or an AuthError code if an error | ||
/// occurred. | ||
AuthError UseUserAccessGroup(const char* access_group); | ||
|
||
private: | ||
/// @cond FIREBASE_APP_INTERNAL | ||
friend class ::firebase::App; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -608,5 +608,23 @@ void DisableTokenAutoRefresh(AuthData *auth_data) {} | |
void InitializeTokenRefresher(AuthData *auth_data) {} | ||
void DestroyTokenRefresher(AuthData *auth_data) {} | ||
|
||
AuthError Auth::UseUserAccessGroup(const char* access_group_str) { | ||
if (!auth_data_) { | ||
return kAuthErrorUninitialized; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No such error, this one doesn't exist, please check the AuthError enum and suggest a better option. |
||
} | ||
NSString* access_group_ns_str = nil; | ||
if (access_group_str != nullptr && strlen(access_group_str) > 0) { | ||
access_group_ns_str = [NSString stringWithUTF8String:access_group_str]; | ||
} | ||
|
||
NSError* error = nil; | ||
BOOL success = [AuthImpl(auth_data_) useUserAccessGroup:access_group_ns_str error:&error]; | ||
if (success) { | ||
return kAuthErrorNone; | ||
} else { | ||
return AuthErrorFromNSError(error); | ||
} | ||
} | ||
|
||
} // namespace auth | ||
} // namespace firebase |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need an Android stub as well.