https://github.com/alexandervantrijffel/msidal
Microsoft Identity Authentication Library For Go (MSAL)
https://github.com/alexandervantrijffel/msidal
jwt ms-identity msal msal-go
Last synced: 6 months ago
JSON representation
Microsoft Identity Authentication Library For Go (MSAL)
- Host: GitHub
- URL: https://github.com/alexandervantrijffel/msidal
- Owner: alexandervantrijffel
- License: mit
- Created: 2021-10-03T07:27:24.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-06-26T09:56:37.000Z (about 4 years ago)
- Last Synced: 2024-06-21T13:05:05.009Z (about 2 years ago)
- Topics: jwt, ms-identity, msal, msal-go
- Language: Go
- Homepage:
- Size: 24.4 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# msidal
Microsoft Identity Authentication Library For Go
### Installation
Install the package with the following command.
```
go get github.com/alexandervantrijffel/msidal
```
#### Usage
Example calling code for verifying an MSAL based JWT bearer token. This verifies the audience, signature and expiration validity of the token.
```
import (
"github.com/alexandervantrijffel/msidal"
)
settings := AzureSettings{
TenantID: "Directory (tenant) ID",
ClientID: "Application (client) ID",
ActiveDirectoryEndpoint: "https://login.microsoftonline.com/",
}
token, err := msidal.VerifyToken(&settings, "Bearer ey......")
```
Example for parsing claims from the returned oidc Token:
```
var claims struct {
Name string `json:"name"`
UserName string `json:"preferred_username"`
}
token.Claims(&claims)
```