.NET Xamarin.iOS AppleLogin System assigned UserRoles

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.

  1. AppStart: User Login decision (Basic / AppleLogin)
  2. BasicLogin & AppleLogin returns user-object + user-roles
  3. 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:
AppleLoginfollowing your guide here works as expected
BasicLoginfollowing 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 });

}

Hello @Janis

We’ll investigate your issue as soon as possible. Internal ticket - BKNDLSS-25349.

Regards,
Inna

1 Like