Backendless Version “Online”
Client SDK (.NET Nuget 6.2.0)
Application ID
852EE6BB-B3FF-A610-FF25-F064DAE8E300
Expected Behavior
When the user choose AppleLogin at first AppStart (instead of BasicLogin), it should have the same behavior in User assigned Roles.
Please describe the expected behavior of the issue, starting from the first action.
- AppStart: User Login decision (Basic / AppleLogin)
- BasicLogin & AppleLogin returns user-object + user-roles
- App shows user specific content
Actual Behavior
On AppleLogin, the user only has this auto-assigned roles: “DotNetUser, NotAuthenticatedUser”
On BasicLogin, the roles are: “DotNetUser, AuthenticatedUser”
I cannot explain this difference, but it destroys the concept of RoleBased access right now for me. especially due to I cannot lock-out the NotAuthenticatedUsers.
Explanations:
AppleLogin → following your guide here works as expected
BasicLogin → following your BasicAuth .NET-Guide
Sample Code:
using Xamarin.Essentials;
public static async Task<BackendlessUser> AppleLoginAsync()
{
try
{
//Apple Auth
WebAuthenticatorResult r = null;
if (DeviceInfo.Platform == DevicePlatform.iOS
&& DeviceInfo.Version.Major >= 13)
{
// Use Native Apple Sign In API's
r = await AppleSignInAuthenticator.AuthenticateAsync(
new AppleSignInAuthenticator.Options {
IncludeEmailScope = true,
IncludeFullNameScope = true });
}
else
throw new Exception("System not supported");
//The Token
var accessToken = r?.Properties["id_token"];
//Backendless CustomService AppleLogin API
var loggedInUser = await BackendlessAuth(accessToken);
return loggedInUser;
}
catch (Exception ex)
{
WriteLine($"Error {ex.Message}");
throw ex;
}
}
static async Task BackendlessAuth(string token)
{
var backendlessUser = await Backendless.CustomService.InvokeAsync<BackendlessUser>("AppleAuth", "login", new object[] { accessToken });
}