From the course: Creating .NET MAUI Applications with Blazor
Unlock the full course today
Join today to access over 24,900 courses taught by industry experts.
Implementing authentication with Auth0: Part 2 - .NET MAUI Tutorial
From the course: Creating .NET MAUI Applications with Blazor
Implementing authentication with Auth0: Part 2
- [Instructor] We are now ready to implement the login call. Since you're making a call to a web service, this call needs to be async, so let's add that keyword in. And the method also returns a Boolean. So we're going to add a variable to have the return value and we're going to return that instead of just true. And we don't really want to bother making the call if we're offline. So this is where the platform helper comes in as there is and is online method. So what we're going to put in an if statement, so we'll go if and underscore platform helper is online. And if we actually are online, we do want to do some work. And we'll check to see if that is equal to true. And we'll need to await that as a is a task returning asynchronous method. If we get by the online check, we can prepare the call and we'll make a variable to hold the response. So that'll be HTTP response message and that will be response. And we'll set…