Skip to content

Commit

Permalink
Fixed redirect_uri
Browse files Browse the repository at this point in the history
  • Loading branch information
JulianFun123 committed Jun 10, 2021
1 parent eda0a56 commit 90ad1c2
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public List<String> getScopes() {
}

public static class AuthorizationURLBuilder {
private String redirectUrl;
private String redirectUri;
private String state;
private List<String> scopes = new ArrayList<>();

Expand All @@ -79,7 +79,7 @@ public AuthorizationURLBuilder addScopes(String ...scope){
}

public AuthorizationURLBuilder setRedirectUrl(String redirectUrl) {
this.redirectUrl = redirectUrl;
this.redirectUri = redirectUrl;
return this;
}
public AuthorizationURLBuilder setState(String state) {
Expand All @@ -93,7 +93,7 @@ public String getState() {
return state;
}
public String getRedirectUrl() {
return redirectUrl;
return redirectUri;
}

private String encodeUrl(String component){
Expand All @@ -110,7 +110,7 @@ public String build(){
+"/auth/oauth2"
+"?client_id="+encodeUrl(clientId)
+"&scope="+encodeUrl(String.join(" ", scopes))
+(redirectUrl == null ? "" : "&redirect_url="+encodeUrl(redirectUrl))
+(redirectUri == null ? "" : "&redirect_url="+encodeUrl(redirectUri))
+(state == null ? "" : "&state="+encodeUrl(state));
}
}
Expand Down

0 comments on commit 90ad1c2

Please sign in to comment.