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

Combine authentication methods into one method #180

Closed
orenbm opened this issue Oct 19, 2020 · 0 comments · Fixed by #179
Closed

Combine authentication methods into one method #180

orenbm opened this issue Oct 19, 2020 · 0 comments · Fixed by #179

Comments

@orenbm
Copy link
Member

orenbm commented Oct 19, 2020

The public API for authentication is currently separated into 2 parts:

  1. Authenticate
  2. ParseAuthenticationResponse

Consumers of the authn-client library currently need to first call the Authenticate method, get the output and call the method ParseAuthenticationResponse with it. This adds redundant complexity to the flow and can be reduced easily by letting the Authenticate method perform the whole flow by itself, so that consumers can call one method without the need of another.

So, instead of performing the following:

resp, err := authn.Authenticate()
if err != nil {
	// Do something
}

err = authn.ParseAuthenticationResponse(resp)
if err != nil {
	// Do something
}

consumers can perform the following:

err := authn.Authenticate()
if err != nil {
	// Do something
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

1 participant