-
Notifications
You must be signed in to change notification settings - Fork 143
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
Add flag to authenticate with OIDC mode #57
Conversation
3168830
to
963c579
Compare
@@ -421,6 +450,10 @@ public AuthenticationRequest loginWithEmail(@NonNull String email, @NonNull Stri | |||
@SuppressWarnings("WeakerAccess") | |||
@Deprecated | |||
public Request<UserProfile, AuthenticationException> tokenInfo(@NonNull String idToken) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is wrong, userInfo is meant for access_token
@@ -191,6 +212,12 @@ public void setUserAgent(String userAgent) { | |||
*/ | |||
@SuppressWarnings("WeakerAccess") | |||
public AuthenticationRequest login(@NonNull String usernameOrEmail, @NonNull String password, @NonNull String connection) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I'd do is to chose the grant type and legacy endpoint based on the pipeline flag. If it's off, ro and connection is used otherwise token and realm
@@ -223,7 +250,7 @@ public AuthenticationRequest login(@NonNull String usernameOrEmail, @NonNull Str | |||
Map<String, Object> requestParameters = ParameterBuilder.newBuilder() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd keep this as it was, using password grant, since realm grant without a realm is pretty useless. We can recommend using the other method and even deprecating this or explaining the default directory restriction of password grant
f8e2c16
to
f281ef4
Compare
f281ef4
to
792be5d
Compare
792be5d
to
b768025
Compare
Make legacy authentication methods use
/oauth/token
endpoint ifclient.setOAuth2Preferred(true)
is called. The methods that change it's behavior with the flag are:login(String, String, String)
--> callslogin(String, String)
and sets the connection as realm.tokenInfo(String)
--> callsuserInfo(String)
signUp(String, String, String)
--> replaces the login call withlogin(String, String)
and sets the connection as realm.signUp(String, String, String, String)
--> replaces the login call withlogin(String, String)
and sets the connection as realm.This PR depends on #56 as there was no way to set a
realm
value before that.