Skip to content

AuthenticationClient methods imply Async #14

@mfulgo

Description

@mfulgo

The method signatures on the AuthenticationClient seem a bit conflicting to me: The methods both return the AuthenticationResponse as well as feeding that value to the AuthenticationStateHandler before returning. Typically, when passing in a handler such as this, I'd expect the method to be asynchronous and to return void.

What I'd propose is to restructure it a bit so a) the methods do not take the handler and b) the case logic lives in the handler or a separate class.

AuthenticationStateHandler handler = createMyHandler();
AuthenticationResponse response = client.authenticate(user, pass, relayState);
handler.handle(response);
 // or response.process(handler); or something else

Perhaps there's a reason for this approach, but I didn't find one in the commit history. If there's a better place to have this discussion, please feel free to redirect me and close this.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions