SOLVED

Graph API access without using client id and secret key

Highlighted
Occasional Contributor

I have a C# Application that reads O365 groups and teams Information using graph API and generates a report. I am able to read and write teams info using graph API by authenticating using tenant info, client id and secret key (these values come from Azure APP registration). I am trying to avoid this App Registration step(tool requires client id and user login to get information). Is there any possible way to do authentication without client id?(like graph explorer does)

https://docs.microsoft.com/en-us/graph/sdks/choose-authentication-providers?tabs=CS

Above auth provider link doesn't have any authentication without clientid.

Authentication used in the tool:

static String[] sca = { "https://graph.microsoft.com/.default" };

var auth = PublicClientApplicationBuilder
.Create(clientid)
.WithTenantId(tenantid)
.Build();
InteractiveAuthenticationProvider authProvider = new InteractiveAuthenticationProvider(auth , sca);

 

 

2 Replies
Highlighted
Best Response confirmed by ThereseSolimeno (Microsoft)
Solution

Well you are the one deciding what type of authentication the application will use, if you want it to run in a user context simply switch to the corresponding mode. Do note that the permissions of the current user will apply for any queries you run via the app in such scenario, so you will only get access to groups/teams the user is a member of.

Highlighted

@User1_Infosys 

 

Accessing Graph API requires App Registration on Azure AD. Graph Explorer is also registered as an enterprise application on Azure AD.