Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Wasm] Documentation and examples for OpenId Connect Authentication #3393

Closed
1 task done
jhancock4d opened this issue Jun 17, 2020 · 6 comments · Fixed by #5515
Closed
1 task done

[Wasm] Documentation and examples for OpenId Connect Authentication #3393

jhancock4d opened this issue Jun 17, 2020 · 6 comments · Fixed by #5515
Assignees
Labels
difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. platform/wasm 🌐 Categorizes an issue or PR as relevant to the WebAssembly platform project/documentation 📖 Categorizes an issue or PR as relevant to documentation

Comments

@jhancock4d
Copy link

What would you like clarification on:

Right now the standard authentication is OpenID connect. On C# that means using IdentityModel.OidcClient as the client library which works great on UWP, Android and iOS (and presumably works on Uno but it isn't clear.)

We really need documentation on how to do standardized OpenidConnect authentication that works across all platforms including WASM. Ideally we would be able to use IdentityModel.OidcClient and provide our own IBrowser implementation that did some sort of redirect on the same page and came back, captured the url and passed it back and authenticated.

Concern?

  • [X ] Getting started with Uno
  • [X ] Developing with Uno
  • [X ] Support

For which Platform:

  • [X ] iOS
  • [X ] Android
  • [X ] WebAssembly
  • macOS
  • [X ] Windows

Anything else we need to know?

Basically Uno to be viable with most new apps needs to be able to handle OpenIdConnect across all platforms. Flutter struggles mightily over this as an example with no single plugin that handles all 3 platforms well making it a non-starter for Web + iOS + Android right now for most LoB applications. Uno could have significant advantages to flutter if this functoinality was available and well documented either by extending IdentityModel.OidcClient to work with WASM itself or using the current functionality and providing an example of IBrowser for IdentityModel.OidcClient that would work.

@jhancock4d jhancock4d added kind/consumer-experience triage/untriaged Indicates an issue requires triaging or verification labels Jun 17, 2020
@jeromelaban
Copy link
Member

Thanks for the request!

At this point, we only looked at the implementation for MSAL.NET, but we're opened to suggestions. If you have an existing Uno sample that you'd like to see working on WebAssembly that does not work, could you please post it here ?

@jeromelaban jeromelaban added platform/wasm 🌐 Categorizes an issue or PR as relevant to the WebAssembly platform and removed triage/untriaged Indicates an issue requires triaging or verification labels Jun 18, 2020
@jeromelaban jeromelaban changed the title Please and documentation and examples on OpenId Connect Authentication [Wasm] Documentation and examples for OpenId Connect Authentication Jun 18, 2020
@jhancock4d
Copy link
Author

I don't even have a direction to go to make this work cross platform. MSAL.net and Microsoft authentication would be used by an vanishingly small portion of users because it's both tied to Microsoft and incredibly limited in the b2c version. In C# land they're either using IdentityServer4 or Open-Adict for servers. In general however, Uno needs to have support or at least a sample that allows authentication and renewal for all platforms against ANY OpenIdConnect compliant server. (Microsoft or otherwise)

Basically I'd be looking for a sample that has .net Core with IdentityServer4 on it as the IdP and then some sort of implementation in uno that will work across all platforms to login to said IdP. This means on web that it would use code flow with pkce and without client secret and would do auth token updates based on an iframe implementation that calls the endpoint using cookies. On ios, android, windows etc. this would use client secret and request an updated auth token based on the refresh token flow.

Note that the web flow is completely different than the actual client flow.

@xperiandri
Copy link
Contributor

xperiandri commented Jun 29, 2020

@jhancock4d I think that my issue #3433 covers what you requested in general.
And with https://github.com/IdentityModel/IdentityModel.OidcClient.Samples can be used for any OIDC server.

GitHub
Contribute to IdentityModel/IdentityModel.OidcClient.Samples development by creating an account on GitHub.

@xperiandri
Copy link
Contributor

For the web, it is much better to open a popup window then redirect from the app and back in terms of UX and performance.

@JohnGalt1717
Copy link

@xperiandri popup window doesn't work in firefox. There is no way to launch it quickly enough that Firefox won't block the popup causing a bad experience for end users sadly.

@agneszitte agneszitte added project/documentation 📖 Categorizes an issue or PR as relevant to documentation and removed kind/consumer-experience labels Sep 21, 2020
@JohnGalt1717
Copy link

JohnGalt1717 commented Nov 30, 2020

One presumes that this would work on everything but web: https://github.com/IdentityModel/IdentityModel.OidcClient

?

Could this be extended to support webassembly and handle the redirects?

GitHub
Certified C#/NetStandard OpenID Connect Client Library for native mobile/desktop Applications (RFC 8252) - IdentityModel/IdentityModel.OidcClient

@jeromelaban jeromelaban added the difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. label Feb 15, 2021
@carldebilly carldebilly linked a pull request Mar 19, 2021 that will close this issue
6 tasks
@mergify mergify bot closed this as completed in #5515 Mar 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. platform/wasm 🌐 Categorizes an issue or PR as relevant to the WebAssembly platform project/documentation 📖 Categorizes an issue or PR as relevant to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants