4
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2025-09-19 04:52:31 +00:00

Remove replace directives and use own fork to make go get work again (#1028)

See https://github.com/golang/go/issues/30354
go get doesn't honor the go.mod replace options.
This commit is contained in:
Wim
2020-03-08 17:08:18 +01:00
committed by GitHub
parent 2a0bc11b68
commit 9785edd263
3308 changed files with 291 additions and 291 deletions

View File

@@ -1,27 +0,0 @@
package msauth
import (
"context"
"golang.org/x/oauth2"
"golang.org/x/oauth2/clientcredentials"
"golang.org/x/oauth2/microsoft"
)
// ClientCredentialsGrant performs OAuth 2.0 client credentials grant and returns auto-refreshing TokenSource
func (m *Manager) ClientCredentialsGrant(ctx context.Context, tenantID, clientID, clientSecret string, scopes []string) (oauth2.TokenSource, error) {
config := &clientcredentials.Config{
ClientID: clientID,
ClientSecret: clientSecret,
TokenURL: microsoft.AzureADEndpoint(tenantID).TokenURL,
Scopes: scopes,
AuthStyle: oauth2.AuthStyleInParams,
}
var err error
ts := config.TokenSource(ctx)
_, err = ts.Token()
if err != nil {
return nil, err
}
return ts, nil
}