ASAuthorizationController¶
Inherits: RefCounted < Object
Manages authorization requests for Apple ID and other services.
Description¶
This class handles the presentation and management of authorization flows, such as Sign in with Apple. It interacts with the ASAuthorizationAppleIDCredential and ASPasswordCredential classes to return the result of an authorization request.
You can use signin_with_scopes() to request specific scopes (e.g., full name and email) or signin() for a default sign-in flow.
var auth_controller = ASAuthorizationController.new()
func _ready():
auth_controller.authorization_completed.connect(_on_authorization_completed)
auth_controller.authorization_failed.connect(_on_authorization_failed)
func _on_sign_in_button_pressed():
# Request full name and email
auth_controller.signin_with_scopes(["full_name", "email"])
func _on_authorization_completed(credential):
if credential is ASAuthorizationAppleIDCredential:
print("User ID: ", credential.user)
print("Email: ", credential.email)
print("Full Name: ", credential.fullName)
elif credential is ASPasswordCredential:
print("User: ", credential.user)
print("Password: ", credential.password)
func _on_authorization_failed(error_message):
print("Authorization failed: ", error_message)
Methods¶
void |
signin() |
void |
signin_with_scopes(scopeStrings: Array) |
Signals¶
authorization_completed(credential: RefCounted) 🔗
Emitted when the authorization request completes successfully.
credential is usually an ASAuthorizationAppleIDCredential or ASPasswordCredential. It can be null if the credential type is unsupported.
authorization_failed(error: String) 🔗
Emitted when the authorization request fails.
error contains the localized description of the error.
Method Descriptions¶
void signin() 🔗
There is currently no description for this method. Please help us by contributing one!
void signin_with_scopes(scopeStrings: Array) 🔗
There is currently no description for this method. Please help us by contributing one!