https://github.com/orisano/go-adal
unofficial Active Directory Authentication Library for go
https://github.com/orisano/go-adal
active-directory adal authentication azure-ad golang
Last synced: 9 months ago
JSON representation
unofficial Active Directory Authentication Library for go
- Host: GitHub
- URL: https://github.com/orisano/go-adal
- Owner: orisano
- License: mit
- Created: 2017-07-16T14:45:17.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2025-02-26T09:26:20.000Z (11 months ago)
- Last Synced: 2025-05-07T18:05:50.547Z (9 months ago)
- Topics: active-directory, adal, authentication, azure-ad, golang
- Language: Go
- Homepage:
- Size: 170 KB
- Stars: 16
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-ADAL
[](https://app.travis-ci.com/orisano/go-adal)

unofficial Active Directory Authentication Library for go.
## Installation
```
go get github.com/orisano/go-adal
```
## How to Use
```go
package main
import (
"context"
"io"
"log"
"os"
"github.com/orisano/go-adal"
)
const (
tenant = "common"
resource = "resource.example"
clientID = "xxxxxxxxxxxxxxxxx"
clientSecret = "xxxxxxxxxxxxxxxxx"
)
func main() {
ac, err := adal.NewAuthenticationContext(tenant)
if err != nil {
log.Fatal(err)
}
ctx := context.Background()
client, err := ac.Client(ctx, resource, clientID, clientSecret)
if err != nil {
log.Fatal(err)
}
resp, err := client.Get("http://api.example/v1/resource")
if err != nil {
log.Fatal(err)
}
defer resp.Body.Close()
io.Copy(os.Stdout, resp.Body)
}
```
## Author
Nao Yonashiro (@orisano)
## License
MIT