Jump to content

How to know if user authenticated successfully


BillOatman
Go to solution Solved by Luke,

Recommended Posts

BillOatman

Hi.  I make this call:

 MediaBrowser.Model.Users.AuthenticationResult authResult = await EmbyClient.AuthenticateUserAsync(user, pass);

What is the suggested way to determine if the authentication was successful?  Is it by checking 

            if(string.IsNullOrEmpty(authResult.AccessToken))
                loggedIn = false;
            else
                loggedIn = true;

 

Link to comment
Share on other sites

  • Solution

Hi, it's simply by whether it throws an exception or not, so all you need is try/catch.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...