Skip to content
This repository has been archived by the owner on Jan 21, 2022. It is now read-only.

MASUser.getCurrentUser().getUserName() is null after Login Success #396

Open
marcocanino opened this issue Sep 29, 2021 · 2 comments
Open

Comments

@marcocanino
Copy link

After a successfull login, when i call this method, i cannot retraive the username.
In MAS SDK 1.9.00 this works. In MAS SDK 2.1.00 this not works anymore.
There are others solutions or methods?

Thanks in advance

@arindamhit
Copy link
Contributor

@marcocanino I can get the user name. I am using MAS SDK 2.1

My code is:

MASUser.login(new MASCallback<MASUser>() {
            @Override
            public void onSuccess(MASUser result) {
                Log.d("ESCALATION", "Logged in as:: Identifier:: " + MASDevice.getCurrentDevice().getIdentifier());
                Log.d("ESCALATION", "Login in as: User Name:: " +MASUser.getCurrentUser().getUserName());
            }

            @Override
            public void onError(Throwable e) {
                Log.d("ESCALATION", "Login failure: " + e);
            }
        });

    }

And on log, it is getting printed:

2021-09-29 14:38:56.329 8244-8287/com.ca.mas.massample D/ESCALATION: Logged in as:: Identifier:: 7377b7fe823b5cfacae1bf6b233a4fa4e26858e484314e9d28dd3b39a17c8518 2021-09-29 14:38:56.331 8244-8287/com.ca.mas.massample D/ESCALATION: Login in as: User Name:: admin

@marcocanino
Copy link
Author

marcocanino commented Sep 29, 2021

@marcocanino I can get the user name. I am using MAS SDK 2.1

My code is:

MASUser.login(new MASCallback<MASUser>() {
            @Override
            public void onSuccess(MASUser result) {
                Log.d("ESCALATION", "Logged in as:: Identifier:: " + MASDevice.getCurrentDevice().getIdentifier());
                Log.d("ESCALATION", "Login in as: User Name:: " +MASUser.getCurrentUser().getUserName());
            }

            @Override
            public void onError(Throwable e) {
                Log.d("ESCALATION", "Login failure: " + e);
            }
        });

    }

And on log, it is getting printed:

2021-09-29 14:38:56.329 8244-8287/com.ca.mas.massample D/ESCALATION: Logged in as:: Identifier:: 7377b7fe823b5cfacae1bf6b233a4fa4e26858e484314e9d28dd3b39a17c8518 2021-09-29 14:38:56.331 8244-8287/com.ca.mas.massample D/ESCALATION: Login in as: User Name:: admin

Hi Arindamhit,

Thanks for reply

The login method you sent don't use the credentials... how can it works?
You are using the method

login(final MASCallback<MASUser> callback)

but I need

public static void login(@NonNull String userName, @NonNull char[] cPassword, MASCallback<MASUser> callback)

I don't think is the same.

Schermata 2021-09-29 alle 11 48 26

Let me know.

Thanks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants