Forum Discussion
Oauth 2.0 authentication in Hololens
One potential solution is to use the Microsoft Authentication Library (MSAL) for authentication and authorization in your application. MSAL provides a set of libraries and APIs that make it easier to integrate with OAuth 2.0 and OpenID Connect providers like Azure AD.
To get started with MSAL, you can follow these steps:
Install the MSAL NuGet package in your HoloLens project.
Create an instance of the PublicClientApplication class, which represents your application's connection to the authentication service.
scss
Copy code
IPublicClientApplication app = PublicClientApplicationBuilder
.Create(clientId)
.WithAuthority(authority)
.Build();
Call the AcquireTokenInteractive method to initiate the authentication flow.
csharp
Copy code
var scopes = new string[] { "user.read" };
var result = await app.AcquireTokenInteractive(scopes).ExecuteAsync();
This will launch a browser window on the HoloLens, allowing the user to authenticate and authorize your application.
Once the user has granted consent, the authentication result will contain an access token that you can use to access protected resources.
c
https://www.allminecraftapk.com/
string accessToken = result.AccessToken;
With MSAL, you can also handle refresh tokens and other authentication scenarios, such as using client credentials or device code authentication.
I hope this helps you get started with integrating OAuth 2.0 into your HoloLens application. If you continue to experience issues, it may be helpful to consult the MSAL documentation or reach out to Microsoft support for further assistance http://allminecraftapk.com/.
HiMuneeb07 , thanks for replying to me! Unfortunately, I am using three party provider(auto desk), which had nothing to do with Microsoft account, it doesn't need to use Microsoft account. What I know about MSAL was, it does not support non-Azure identity providers.