Skip to content

How to get the bearer token through API ? #6241

Discussion options

You must be logged in to vote

What are you trying to do with the bearer token? Can you use fly? or maybe go-concourse? Anyway it sounds like you're trying to reverse-engineer this code:

func (command *LoginCommand) passwordGrant(client concourse.Client, username, password string) (string, string, error) {
oauth2Config := oauth2.Config{
ClientID: "fly",
ClientSecret: "Zmx5",
Endpoint: oauth2.Endpoint{TokenURL: client.URL() + "/sky/issuer/token"},
Scopes: []string{"openid", "profile", "email", "federated:id", "groups"},
}
ctx := context.WithValue(context.Background(), oauth2.HTTPClient, client.HTTPClient())

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
5 replies
@kalrashubham49
Comment options

@jamieklassen
Comment options

@chris-aeviator
Comment options

@jamieklassen
Comment options

@gsaslis
Comment options

Answer selected by jamieklassen
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants