Hey @k.oak,
I think you need to create an Action to handle the Post Login trigger and use the Session Management API to find a valid session for the current user on the current device.
Hello @andrea.chiarelli - Thank you for your reply. Looks like session management apis are available only for enterprise users. We are small business and cant really afford enterprise license. I think this is pretty common use case and not every user can opt for enterprise edition. Is there any other way to avoid same user logging into multiple devices?
Hi @k.oak,
Honestly, I’m not sure about the best solution to emulate the Session Management API behavior.
My first thought is to use the event.session
object in a Post Login trigger to get the needed data for the current user session and the event.user.app_metadata
object to store it.
At login time, check if the current user is already logged in by comparing the relevant current session data with the data stored in the app_metadata
object. If the user is already logged in on another device, deny them access.
I have some concerns about the accuracy of this solution, though, because of the reliability of the session expiration date and the presence of refresh tokens that could “resume” a session if they are not revoked
Hello,
I’ve had the Auth0 utilities working well for some time now.
My app runs in iOS, Android and Windows.
I recently upgraded to target .Net 9.0 framework with all relevant nuget package updates too.
What I’m finding and REALLY struggling to solve is the Webview.Navigated or Webview.Navigating events / event handlers no longer trigger in the WebViewBrowserAuthenticator.cs
This is an issue running in Windows and the need to use a WebView, all seems ok on iOS and Android (for now).
This is NOT an Auth0 issue as this is reported in various webview usages, however, I’m sure this must have been encountered using the mechanisms here.
I was wondering if ANYONE had come across this issue and have found a way to trigger these events in a Maui app?
Thanks for any input!
This no longer triggers…
_webView.Navigated += (sender, e) =>
{
if (e.Url.StartsWith(options.EndUrl))
{
if (tcs.Task.Status != TaskStatus.RanToCompletion)
{
tcs.SetResult(new BrowserResult
{
ResultType = BrowserResultType.Success,
Response = e.Url.ToString()
});
}
}
};
Unfortunately, I currently don’t have an answer to your question. I hope that someone in the community can help
Hi,
Started using Auth SDK for .NET Maui.
.Net8 works fine, but when testing with .net9 following error is triggered after logging in the user (loginasync).
auth0 sdk for .net maui… running it on .net8 works fine, but if using .net9 after calling loginasync i get this error:
IDX20803: Unable to obtain configuration from: https…xxxx.auth0.com:443/.well-known/openid-configuration’. Will retry at ‘27.01.2025 21:04:43 +00:00’. Exception: 'System.TypeLoadException: Could not resolve type with token 0100004e from typeref (expected class ‘Microsoft.IdentityModel.Json.JsonConvert’ in assembly ‘Microsoft.IdentityModel.Tokens, Version=6.34.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’)
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[d__3](d__3& stateMachine)
at Microsoft.IdentityModel.Protocols.OpenIdConnect.OpenIdConnectConfigurationRetriever.GetAsync(String address, IDocumentRetriever retriever, CancellationToken cancel)
at Microsoft.IdentityModel.Protocols.OpenIdConnect.OpenIdConnectConfigurationRetriever.Microsoft.IdentityModel.Protocols.IConfigurationRetriever<Microsoft.IdentityModel.Protocols.OpenIdConnect.OpenIdConnectConfiguration>.GetConfigurationAsync(String address, IDocumentRetriever retriever, CancellationToken cancel)
at Microsoft.IdentityModel.Protocols.ConfigurationManager`1.d__17[[Microsoft.IdentityModel.Protocols.OpenIdConnect.OpenIdConnectConfiguration, Microsoft.IdentityModel.Protocols.OpenIdConnect, Version=6.34.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]].MoveNext()'.
Has anyone had any success using it on a MAUI project running .NET9?
Br,
Sindre
Hi @sindre1,
I haven’t tried to use MAUI with .NET 9 yet. However, the error message does not look like a problem with the .NET version. It sounds more like a configuration problem (but I could be wrong).
Have you tried pointing your browser to the .well-known
configuration endpoint? That https…xxxx.auth0.com:443/.well-known/openid-configuration
you mentioned in your message.
It should return the OIDC configuration (see here for more info). If it returns an error or something not formatted as expected, then there is a problem with the configuration on your Auth0 tenant.
Hi @andrea.chiarelli ,
Thanks for your quick answer
If i test the url in my browser a valid json is displayed.
When changing to net8 in my csproj file the login works just fine, but this error is coming when going back to net9 in my csproj.
I can see in the logs on auth that the login is successfully but app is crashing when returning from the browser to the app with this fault message…
Hi again,
The error was caused by “IdentityModel.OidcClient.IdentityTokenValidator 6.0.0” being used in my project as it were dependent of IdentityModel 7.0.0 and IdentityModel.OidcClient 6.0.0 causing my project to use Microsoft.IdentityModel.Tokens 7.1.2.
Downgrading IdentityModel.OidcClient.IdentityTokenValidator to 5.2.1 “fixed” the problem.
As my project was then using Microsoft.IdentityModel.Tokens 6.34.0.
BR,
Sindre
Awesome! Happy you solved your problem, and thank you for sharing the solution
I am having the same issue in .NET 9. Did you find a solution?
Has anyone found a resolution to this issue?
Add Authentication to .NET MAUI Apps with Auth0Processing: Screenshot_20250218_102753_Chrome.jpg…
<uap:VisualElements
DisplayName=“$placeholder$”
Description=“$placeholder$”
Square150x150Logo=“$placeholder$.png”
Square44x44Logo=“$placeholder$.png”
BackgroundColor=“transparent”>
<uap:DefaultTile Square71x71Logo=“$placeholder$.png” Wide310x150Logo=“$placeholder$.png” Square310x310Logo=“$placeholder$.png” />
<uap:SplashScreen Image=“$placeholder$.png” />
</uap:VisualElements>
<uap:Extension Category=“windows.protocol”>
<uap:Protocol Name=“myapp”>
uap:DisplayNameMauiAuth0App</uap:DisplayName>
</uap:Protocol>
</uap:Extension>