Running the Dev Apps for MSAL Go
To run one of the dev app which uses MSAL Go, the config.json
file and the confidential_config.json
should look like the following:
{
"authority": "https://login.microsoftonline.com/organizations",
"client_id": "your_client_id",
"scopes": ["user.read"],
"username": "your_username",
"password": "your_password",
"redirect_uri": "redirect uri registered on the portal",
"code_challenge": "transformed code verifier from PKCE",
"state": "state parameter for authorization code flow",
"client_secret": "client secret you generated for your app",
"thumbprint": "the certificate thumbprint defined in your app generation",
"pem_file": "the file path of your private key pem"
}
The dev apps in this repo get tokens for the MS Graph API. To find permissible scopes for MS Graph, visit this link. PKCE is explained here.
On Windows
To run the dev samples:
cd test/devapps
run the command:
'go run ./ 1'
Alternatives:
On Mac
To run one of the devapps, run the command go run src/test/devapps/*.go <devapps-number>
. The devapp numbers are as follows:
- 1 -
device_code_flow_sample.go
- 2 -
authorization_code_sample.go
- 3 -
username_password_sample.go
- 4 -
confidential_auth_code_sample.go
- 5 -
client_secret_sample.go
- 6 -
client_certificate_sample.go