Skip to content

devpro/azuread-jwt-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Azure AD JWT Generator

Command line tool to generate authentication tokens with Azure Active Directory.

How to use the tool

aadtokengen <client_id> <tenant_id> <username> <userpassword> <scope>

How to set up an application in Azure

  • In Azure Portal, in "Azure Active Directory > Application registrations", select "New registration"

  • Once created, update the application

    • "Manifest": manually edit the file (accessTokenAcceptedVersion and allowPublicClient are null by default)
    {
      "accessTokenAcceptedVersion": 2,
      "allowPublicClient": true,
    }
    • "Api permissions": do "Grant admin consent for Default Directory" (Microsoft Graph > User.Read has been added by default)
    • "Expose an API": set the application ID URI ("api://<client_id>" is the default and correct choice)
    • "Expose an API": add a scope (for example "access_as_user", "Admins and users" can consent)

How to debug in Visual Studio

  • Create the src/ConsoleApp/Properties/launchSettings.json file
{
  "profiles": {
    "ConsoleApp": {
      "commandName": "Project",
      "commandLineArgs": "<client_id> <tenant_id> <username> <userpassword> <scope>"
    }
  }
}

About

Command line tool to generate authentication tokens with Azure Active Directory

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Languages