Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 7 days 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 7 years ago)
- Default Branch: master
- Last Pushed: 2023-10-11T23:21:36.000Z (about 1 year ago)
- Last Synced: 2024-11-02T09:51:42.807Z (14 days ago)
- Topics: active-directory, adal, authentication, azure-ad, golang
- Language: Go
- Homepage:
- Size: 169 KB
- Stars: 15
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-ADAL
[![Build Status](https://app.travis-ci.com/orisano/go-adal.svg?branch=master)](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 mainimport (
"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