How to generate Access Token using OAUTH using clientid, client secret and Scope

Ashok K 1 Reputation point
2021-09-05T23:01:48.21+00:00

Hi,

i never done Oauth token generator work, Can any one give me sample code how to generate access token using:

ClientId client secret and Scope

Thanks
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,307 questions
VB
VB
An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,580 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. P a u l 10,406 Reputation points
    2021-09-06T00:47:17.553+00:00

    I'm guessing that this is related to Azure Active Directory authorisation. Here's a good overview of the authorisation flow:
    https://learn.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-auth-code-flow

    The flow can be different depending on whether it's a web/desktop/mobile, and if it's a single-page-application then it's a bit different again:
    https://learn.microsoft.com/en-us/azure/active-directory/develop/authentication-flows-app-scenarios#scenarios-and-supported-authentication-flows

    Once you have an idea of the scenario that suits your use case you can find some example projects on this page:
    https://learn.microsoft.com/en-us/azure/active-directory/develop/sample-v2-code

    I'd recommend just cloning the repo and having a play around with the examples.

    0 comments No comments