auth0 / auth0-flutter

Auth0 SDK for Flutter
https://pub.dev/documentation/auth0_flutter/latest/
Apache License 2.0
57 stars 36 forks source link

Feature/add openUrl support #393

Open JCQuintas opened 6 months ago

JCQuintas commented 6 months ago

📋 Changes

This is important to me due to the @microsoft/teams-js library necessary to do authentication inside microsoft teams, reference docs here

In short, it handles authentication in its own window.

authentication.authenticate({
    url: window.location.origin + "/tab-auth/simple-start-v2",
    width: 600,
    height: 535})

My use case would be something similar to

auth0.loginWithRedirect(openUrl: (auth0Url) async {
  authentication.authenticate(
    url: "$auth0Url/tab-auth/simple-start-v2",
    width: 600,
    height: 535
  )
})

🎯 Testing

Possible concerns

While manual testing, you will also see two errors in the web console:

From my tests, this seems be comming out of the main auth0-spa-js library due to unhandled rejections, and doesn't affect the usage of auth0_flutter itself. Though it would require a deeper research on why it is happening.

JCQuintas commented 6 months ago

@Widcket @poovamraj Hi, please let me know if I am missing any step for this to be reviewed 😄