The purpose of the script is to retrieve an AcceesToken from AzureAD. There script supports several flows.
A registered application in AzureAD
ADAL library installed
Username to prepopulate when using ADAL
Path to Microsoft.IdentityModel.Clients.ActiveDirectory DLL
Application ID of the registered app
The resource you want the AccessToken for. It is also known as the audience(aud) of a token.
This can be used for entering either "Sign-On URL" for "Web app/API" or "Redirect URI" for "Native" application.
The ADAL's PromptBehavior. Always, Auto, Never or RefreshSession are valid values. Default is Auto.
Switch to check whether a token for specific resource exists in your ADAL cache.
The certificate, which is used for Client Credentials flow.
PS credential object for acquiring a token.
The secret, which is used for Client Credentials flow.
Application ID of the registered app in the On-Behalf-Of flow.
The secret, which is used in the On-Behalf-Of flow.
The resource/audience in the On-Behalf-Of flow.
The authority from where you get the token.
Clear ADAL cache in order to retrieve a new token. ADAL checks whether you have a token or not before acquiring a new one. This can be helpful for debugging.
Switch for implicit flow.
Switch for AuthCode flow.
Switch for OBO flow.
When using either Implicit or AuthCode flow, you can set the prompt. login, select_account, consent, admin_consent and none are valid values. Default is none.
Switch for parsing the AccessToken.
Required when using Implicit or AuthCode flow.
If you want to parse an existing AccessToken, just provide the value of the token to this parameter.