-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
177 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
69 changes: 69 additions & 0 deletions
69
...wso2/carbon/identity/rest/api/user/association/v1/dto/FederatedAssociationRequestDTO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
/* | ||
* Copyright (c) 2025, WSO2 LLC. (http://www.wso2.com) All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.wso2.carbon.identity.rest.api.user.association.v1.dto; | ||
|
||
import io.swagger.annotations.*; | ||
import com.fasterxml.jackson.annotation.*; | ||
|
||
import javax.validation.Valid; | ||
import javax.validation.constraints.NotNull; | ||
import javax.validation.constraints.Pattern; | ||
|
||
@ApiModel(description = "") | ||
public class FederatedAssociationRequestDTO { | ||
|
||
@Valid | ||
private String idp = null; | ||
|
||
@Valid | ||
private String federatedUserId = null; | ||
|
||
/** | ||
**/ | ||
@ApiModelProperty(value = "") | ||
@JsonProperty("idp") | ||
public String getIdp() { | ||
return idp; | ||
} | ||
public void setIdp(String idp) { | ||
this.idp = idp; | ||
} | ||
|
||
/** | ||
**/ | ||
@ApiModelProperty(value = "") | ||
@JsonProperty("federatedUserId") | ||
public String getFederatedUserId() { | ||
return federatedUserId; | ||
} | ||
public void setFederatedUserId(String federatedUserId) { | ||
this.federatedUserId = federatedUserId; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
|
||
StringBuilder sb = new StringBuilder(); | ||
sb.append("class FederatedAssociationRequestDTO {\n"); | ||
|
||
sb.append(" idp: ").append(idp).append("\n"); | ||
sb.append(" federatedUserId: ").append(federatedUserId).append("\n"); | ||
|
||
sb.append("}\n"); | ||
return sb.toString(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -418,6 +418,49 @@ paths: | |
$ref: '#/definitions/Error' | ||
tags: | ||
- admin | ||
post: | ||
summary: Create federated user association | ||
description: | | ||
This API is used to create federated user associations. <br> | ||
<b>Permission required:</b> | ||
* /permission/admin/manage/identity/user/association/create | ||
<b>Scope required:</b> | ||
* internal_user_association_create | ||
parameters: | ||
- name: user-id | ||
in: path | ||
required: true | ||
description: user id | ||
type: string | ||
- name: association | ||
in: body | ||
description: User details to be associated. | ||
required: true | ||
schema: | ||
$ref: '#/definitions/FederatedAssociationRequest' | ||
responses: | ||
201: | ||
description: Successfully created | ||
schema: | ||
$ref: '#/definitions/FederatedAssociation' | ||
400: | ||
description: Bad Request | ||
schema: | ||
$ref: '#/definitions/Error' | ||
401: | ||
description: Unauthorized | ||
schema: | ||
$ref: '#/definitions/Error' | ||
403: | ||
description: Resource Forbidden | ||
schema: | ||
$ref: '#/definitions/Error' | ||
500: | ||
description: Server Error | ||
schema: | ||
$ref: '#/definitions/Error' | ||
tags: | ||
- admin | ||
|
||
/{user-id}/federated-associations/{id}: | ||
delete: | ||
|
@@ -520,6 +563,20 @@ definitions: | |
type: string | ||
example: [email protected] | ||
#----------------------------------------------------- | ||
# The Federated Association Request object | ||
#----------------------------------------------------- | ||
FederatedAssociationRequest: | ||
type: object | ||
properties: | ||
idp: | ||
type: string | ||
example: exampleIdP | ||
description: Name of the IdP | ||
federatedUserId: | ||
type: string | ||
example: [email protected] | ||
description: User identifier in the federated IdP | ||
#----------------------------------------------------- | ||
# The Federated Identity Provider Response object | ||
#----------------------------------------------------- | ||
Idp: | ||
|