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

Core::Credentials::TokenCredential implementation for public clients #3702

Closed
2 tasks done
benstadlbauer opened this issue Jun 3, 2022 · 4 comments
Closed
2 tasks done
Assignees
Labels
Azure.Identity Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that

Comments

@benstadlbauer
Copy link

Query/Question
Is there/or will there be an implementation of the Core::Credentials::TokenCredential class for public clients? Where one does not need to provide a client certificate or client secret. Similar to the .NET PublicClientApplication class or Python PublicClientApplication class. Or is there a way to achieve this using azure-sdk-for-cpp?

Why is this not a Bug or a feature Request?
Not a bug: I'm not running code with expectations different than the outcome. Not a feature request: I'm not suggesting to implement something. I'm simply asking a question.

Setup (please complete the following information if applicable):

  • OS: Windows
  • IDE : Visual Studio
  • Version of the Library used: commit 593464cedaf21b00d7b6fd1467f25ab9284ebe1b azure-core_1.6.0, azure-identity_1.3.0-beta.2

Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report

  • Query Added
  • Setup information Added

Thank you!

@ghost ghost added needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Jun 3, 2022
@RickWinter RickWinter added Client This issue points to a problem in the data-plane of the library. Azure.Identity labels Jun 6, 2022
@ghost ghost removed the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Jun 6, 2022
@antkmsft
Copy link
Member

Hi @benstadlbauer, can you please provide more details, how would you want to use that type of credential? How would you like the code to look like? If you have a code snippet in other language, that's good too.
PublicClientApplication is from MSAL library and not Azure SDK, and there is no publicly available C++ MSAL at the moment. But we may be able figure something out, depending on your scenario.

@benstadlbauer
Copy link
Author

Hey @antkmsft, I'm very new to this library and I wasn't really sure how to formulate the question. I also was not aware, that the MSAL library is something different than the Azure SDK, but I am still not sure how these two relate. According to this stackoverflow post, which refers to this github issue and this other github issue, it seems that MSAL is a building block for AzureSDK.

What I was looking for initially was something like

auto cred = Azure::Identity::PublicClientCredential(getTenantId(), getClientId());
auto tokens = cred.get(getScopes());

which automatically opens up a browser window to sign-in, similar to Get Azure AD tokens by using the MSAL Python library. I'm also not sure how the tokens would look like.

The reason why I ask is I have to implement the authentication process for accessing a resource via a REST API, where the authentication follows a federated authentication. In the end I need to attach a cookie to my requests (among a certificate but I'm not sure about that either), so I guess the variable tokens would contain this cookie somehow. I already have implemented a process using cpprestsdk, but the way I get the cookie now is I recreated the authentication protocol, containing of several HTTP GET and POST requests, each of them returning information for the subsequent ones. This was very tedious.

Conclusion: Apparently I would need a MSAL library for C++, which does not exist (yet).

I don't know enough about these processes (yet) to propose a way how to implement something in this library which could to a federated authentication process interactively (opening a browser window).

@antkmsft
Copy link
Member

antkmsft commented Jul 1, 2022

@benstadlbauer, you are right, if MSAL is available, it can be a dependency for an azure-identity, and then the azure-identity would wrap around some of its functionality and provide support for the scenarios such as interactive log-on with browser window. As I said, unfortunately, there isn't MSAL for C++ at the moment.

So, to your question, there is currently no interactive log on with UI support in the library.

We'll see what we can do, maybe we could provide some class with a virtual function, or with some callback, that gets called and it gives you a URL to display, or an HTML that you can render in the UI, but that won't happen in the next few months at least.

@benstadlbauer
Copy link
Author

@antkmsft thank you for your information. Closing the issue now.

@github-actions github-actions bot locked and limited conversation to collaborators May 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Azure.Identity Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Projects
None yet
Development

No branches or pull requests

3 participants