Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Officially supporting OAuth or SAML token for any Apigee type #66

Merged
merged 1 commit into from
Sep 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion apigee/edge_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,9 @@ func NewEdgeClient(o *EdgeClientOptions) (*EdgeClient, error) {
if e != nil {
return nil, e
}
if o.MgmtURL == defaultBaseURL {
// not overriding if auth token is given
// otherwise enforcing oauth on legacy saas
if o.Auth.BearerToken == "" && o.MgmtURL == defaultBaseURL {
c.auth.MFAToken = o.Auth.MFAToken
e = c.getOAuthToken()
if e != nil {
Expand Down
2 changes: 1 addition & 1 deletion cmd/bindings/bindings.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func Cmd(rootArgs *shared.RootArgs, printf shared.FormatFn) *cobra.Command {
c.PersistentFlags().BoolVarP(&rootArgs.IsOPDK, "opdk", "", false,
"Apigee opdk")
c.PersistentFlags().StringVarP(&rootArgs.Token, "token", "t", "",
"Apigee OAuth or SAML token (hybrid only)")
"Apigee OAuth or SAML token (overrides any other given credentials)")
c.PersistentFlags().StringVarP(&rootArgs.Username, "username", "u", "",
"Apigee username (legacy or OPDK only)")
c.PersistentFlags().StringVarP(&rootArgs.Password, "password", "p", "",
Expand Down
2 changes: 1 addition & 1 deletion cmd/provision/provision.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ to your organization and environment.`,
"Apigee opdk")

c.Flags().StringVarP(&rootArgs.Token, "token", "t", "",
"Apigee OAuth or SAML token (hybrid only)")
"Apigee OAuth or SAML token (overrides any other given credentials)")
c.Flags().StringVarP(&rootArgs.Username, "username", "u", "",
"Apigee username (legacy or OPDK only)")
c.Flags().StringVarP(&rootArgs.Password, "password", "p", "",
Expand Down