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

Acquire UserCredential object with C# running on Android (AvaloniaUI) #2585

Closed
RusselRillema opened this issue Nov 1, 2023 · 2 comments
Closed
Assignees
Labels
priority: p3 Desirable enhancement or fix. May not be included in next release. type: question Request for information or clarification. Not an issue.

Comments

@RusselRillema
Copy link

Hi there
I am writing an C# application, using AvaloniaUI, that will target Android and Desktop (initially). These applications need to communicate with a C# WebAPI and should only be accessible inside of my Google Organization.
When the apllication is deployed as a desktop app I am able to use GoogleWebAuthorizationBroker.AuthorizeAsync to obtain a UserCredential object for use to make requests to my WebAPI.
The same code does not run when I am running the Android App. I get a platform unsupported exception. Avalonia is not explicitly mentioned in the Unsupported Frameworks but I assume it's because of the cross platform and needing access to a browser that it does not know how to interact with.

My question is, is there a recommended approach using a C# library to obtain a similar object to the UserCredential object obtainable by GoogleWebAuthorizationBroker.AuthorizeAsyn?
If not, is there any method of obtaining the necessary token using some sort of OAthu2 SSO approach when running C# on Android?

Currently this is a .net7 project but I can change this to .net8 preview if that will make a difference.

I was hoping issue 2561 would help solve this issue but it looks like that is not the case. I did ask a question on that issue but it sounds like that won't add support for what I am trying to accomplish.

@RusselRillema RusselRillema added priority: p3 Desirable enhancement or fix. May not be included in next release. type: question Request for information or clarification. Not an issue. labels Nov 1, 2023
@amanda-tarafa amanda-tarafa self-assigned this Nov 1, 2023
@amanda-tarafa
Copy link
Contributor

I'm sorry to say that we don't support mobile platforms in general, and for user authentication in particular, the main issue around auth support being what you suspected, browser interaction. We will be looking at how we can improve support in this area, but anything we do, will be long term. There are some alternatives to authenticating app users that you might be able to integrate to your .NET app.

I'm sorry I don't have a better answer for you at the moment.

@RusselRillema
Copy link
Author

Not the answer I was hoping for but very grateful for the answer nonetheless.
Thanks @amanda-tarafa

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p3 Desirable enhancement or fix. May not be included in next release. type: question Request for information or clarification. Not an issue.
Projects
None yet
Development

No branches or pull requests

2 participants