This sample shows how to use a Go web app to sign into using AAD.
If you are looking for client credentials flow, managed identities or device code flow, you should check out Azure SDK at https://docs.microsoft.com/en-us/azure/developer/go/azure-sdk-authorization
- Register a new app in Azure AD
- Add the "web" platform with redirect uri "http://localhost:3000/callback"
- Generate a client secret
- Rename .env.sample to .env and update values
To run
- Run
go build ./...
to build and install the Go dependencies. - Run
go run main.go server.go
to start the app - Point your browser to http://localhost:3000/.
- Login using your credentials.