Giter Club home page Giter Club logo

Comments (20)

Stavvor avatar Stavvor commented on June 14, 2024 1

@dracan @nh43de If you still need this change you can build iOS nuget package form this branch https://github.com/Stavvor/auth0-oidc-client-net/tree/iOSworkaround
LogoutAsync method is returning BrowserResultType so you can react properly for usercancel or httperror

from auth0-oidc-client-net.

nh43de avatar nh43de commented on June 14, 2024

Same problem - if user starts logout process but clicks cancel on the iOS native prompt, there is no way to handle this. Not suitable for production.

from auth0-oidc-client-net.

Stavvor avatar Stavvor commented on June 14, 2024

Any updates on this one?

from auth0-oidc-client-net.

daiplusplus avatar daiplusplus commented on June 14, 2024

@Stavvor can you fix the link in your post? The text is correct, but the href="" is incorrect.

BTW, I saw that you cancelled your PR to introduce this to the repo, why?

from auth0-oidc-client-net.

Stavvor avatar Stavvor commented on June 14, 2024

@Jehoel Thanks i fixed my link to point to the correct adress, I didn't mean to cancel this PR. It was probably an accident

from auth0-oidc-client-net.

jsauve avatar jsauve commented on June 14, 2024

Big thanks for this. I was previously unable to react to user cancellation at the prompt for LogoutAsync().

from auth0-oidc-client-net.

tonyyyrocks39 avatar tonyyyrocks39 commented on June 14, 2024

has anybody got a fix on this...

When calling LogoutAsync, if the logout redirect url hasn't been set up correctly, this logout will fail to work - but there's no indication that it's failed. LogoutAsync doesn't throw an exception, and there's no return value.

from auth0-oidc-client-net.

jsauve avatar jsauve commented on June 14, 2024

@tonyyyrocks39, the fix is in the master branch, but not in the nuget package 2.3.1 yet. You can build the master branch yourself to get the fix. That's what I did.
Tip: I had to convert the Auth0.OidcClient.Core project to a .Net Standard 2.0 project instead of .Net 4.6.

My guess is that it'll be in the nuget soon, but that's up to the Auth0 devs.

from auth0-oidc-client-net.

jsauve avatar jsauve commented on June 14, 2024

Basically, LoginAsync() will now return a Task of BroswerResult. You can check BroswerResult.ResultType for ResultType.Sucess or ResultType.UserCancel.

from auth0-oidc-client-net.

tonyyyrocks39 avatar tonyyyrocks39 commented on June 14, 2024

Question was about Logoutasync(),in platformwebview in the line return tcs.Task;(last line),it just stuck there ,it never returns a browerresult.
I guess this is the reason browser in not returning to the app again

from auth0-oidc-client-net.

jsauve avatar jsauve commented on June 14, 2024

Is your redirect url setup correctly? Use the same redirect url for logout as you use for login.

The ones from the callback url section here:
https://auth0.com/docs/quickstart/native/xamarin/01-login

Makes sure it's in your custom urls in info.plist and equivalent in iOS. (Follow the docs)

Main this is: use the same callback/redirect url for logout as login.

from auth0-oidc-client-net.

jsauve avatar jsauve commented on June 14, 2024

But again, if you're using the latest nuget (2.3.1) LogoutAsync() just retuns a plain Task. You'll need latest from master. And redirect url needs to be set in the Auth0 portal for your app.

from auth0-oidc-client-net.

tonyyyrocks39 avatar tonyyyrocks39 commented on June 14, 2024

Yes,Thanks for quick replies,but i have properly configured redirect url,problem is after that line tcs.Task it should ideally return to return browserResult.ResultType; in Logoutasync which is not happening,may be i need to look into master branch if incase something got changed in platformview class

from auth0-oidc-client-net.

jsauve avatar jsauve commented on June 14, 2024

Definitely try it if you're currently using the nuget. I have a few outstanding PRs waiting for review too. Check em out.

from auth0-oidc-client-net.

tonyyyrocks39 avatar tonyyyrocks39 commented on June 14, 2024

I just tried master branch,there also it seems have problem,browser does not return back to app

from auth0-oidc-client-net.

jsauve avatar jsauve commented on June 14, 2024

If you're able to login to an identity provider successfully, but the browser fails to close afterwards, then there is something misconfigured in regards to the logout callback url. So, let's clarify some things about your current setup:

  1. Are your login callback url and logout callback url identical? They should be. And your callbacks should not contain "https". They should contain your iOS bundle identifier or your Android package name.

  2. Have you ensured that the scheme of your callback url is entered in your info.plist on iOS and in the manifest in Android? This is imperative to the operating system knowing that it should close the browser when it encounters your custom url scheme.

Sorry if my questions seem excessive. I'm just fairly certain that something in regards to the callback url is misconfigured.

from auth0-oidc-client-net.

jsauve avatar jsauve commented on June 14, 2024

...also, have you made sure that your logout callback url is entered in the " Allowed Logout URLs" field of your app in the Auth0 web portal for your Auth0 application? That's also imperative. This means your callback url is entered in TWO fields in the Auth0 portal, not ONLY for the "Allowed Callback URLs" field.

from auth0-oidc-client-net.

tonyyyrocks39 avatar tonyyyrocks39 commented on June 14, 2024

@jsauve if you have some time,please look into the issue#45,I have put my entire codes there.

from auth0-oidc-client-net.

tonyyyrocks39 avatar tonyyyrocks39 commented on June 14, 2024

Somehow I made it to work..But still facing problem,Currently when I debug line by line,logout is happening successfully.But when I directly hit F5 logout not working

from auth0-oidc-client-net.

damieng avatar damieng commented on June 14, 2024

Is there anything left actionable on this issue? It's quite hard to follow. Suggest we continue discussion outstanding remaining issue on #45 ?

from auth0-oidc-client-net.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.