Skip to content
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
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>cn.authing</groupId>
<artifactId>authing-java-sdk</artifactId>
<version>3.1.4</version>
<version>3.1.5</version>

<name>Authing Java SDK</name>
<description>java backend sdk for authing</description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,11 @@ public String buildAuthorizeUrl(IOidcParams params) {
map.put("prompt", params.getScope() != null && params.getScope().contains("offline_access") ? "consent"
: null);
}

if (StrUtil.isNotBlank(params.getTenantId())) {
map.put("tenant_id", params.getTenantId());
}

return HttpUtils.buildUrlWithQueryParams(options.getAppHost() + "/oidc/auth", map);
}

Expand Down Expand Up @@ -461,6 +466,10 @@ public String buildAuthorizeUrl(IOauthParams params) {
params.getScope() != null && params.getScope().contains("offline_access") ? "consent"
: null);

if (StrUtil.isNotBlank(params.getTenantId())) {
map.put("tenant_id", params.getTenantId());
}

return HttpUtils.buildUrlWithQueryParams(options.getAppHost() + "/oidc/auth", map);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ public class AccessToken {
@JsonProperty("aud")
private String aud;

/**
* 租户 ID
*/
@JsonProperty("tenant_id")
private String tenantId;

public String getJti() {
return jti;
}
Expand Down Expand Up @@ -100,4 +106,12 @@ public String getAud() {
public void setAud(String aud) {
this.aud = aud;
}

public String getTenantId() {
return tenantId;
}

public void setTenantId(String tenantId) {
this.tenantId = tenantId;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ public class IOauthParams {

private String redirectUri;

/**
* Tenant ID, optional field
*/
private String tenantId;

public String getScope() {
return scope;
}
Expand Down Expand Up @@ -40,4 +45,12 @@ public String getRedirectUri() {
public void setRedirectUri(String redirectUri) {
this.redirectUri = redirectUri;
}

public String getTenantId() {
return tenantId;
}

public void setTenantId(String tenantId) {
this.tenantId = tenantId;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ public class IOidcParams {

private String prompt;

/**
* Tenant ID, optional field
*/
private String tenantId;

public String getScope() {
return scope;
}
Expand Down Expand Up @@ -72,4 +77,12 @@ public void setPrompt(String prompt) {
public String getPrompt() {
return prompt;
}

public String getTenantId() {
return tenantId;
}

public void setTenantId(String tenantId) {
this.tenantId = tenantId;
}
}