Skip to content
Draft
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
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
/*
* Copyright (c) 2021, WSO2 LLC. (http://www.wso2.org) 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.
*/
* Copyright (c) 2021-2025, WSO2 LLC. (http://www.wso2.org) 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.api.server.authenticators.v1;

Expand All @@ -25,6 +25,7 @@
import org.wso2.carbon.identity.api.server.authenticators.v1.model.Authenticator;
import org.wso2.carbon.identity.api.server.authenticators.v1.model.ConnectedApps;
import org.wso2.carbon.identity.api.server.authenticators.v1.model.Error;
import org.wso2.carbon.identity.api.server.authenticators.v1.model.SystemLocalAuthenticatorUpdate;
import org.wso2.carbon.identity.api.server.authenticators.v1.model.UserDefinedLocalAuthenticatorCreation;
import org.wso2.carbon.identity.api.server.authenticators.v1.model.UserDefinedLocalAuthenticatorUpdate;

Expand Down Expand Up @@ -166,6 +167,59 @@ public Response getConnectedAppsOfLocalAuthenticator(@ApiParam(value = "ID of an
return delegate.getConnectedAppsOfLocalAuthenticator(authenticatorId, limit, offset );
}

@Valid
@GET
@Path("/system/{authenticator-id}")

@Produces({ "application/json" })
@ApiOperation(value = "Get the system local authenticator by Id ", notes = "Get the system local authenticator by Id ", response = Authenticator.class, authorizations = {
@Authorization(value = "BasicAuth"),
@Authorization(value = "OAuth2", scopes = {

})
}, tags={ "System Local Authenticators", })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "Successful response", response = Authenticator.class),
@ApiResponse(code = 400, message = "Invalid input in the request.", response = Error.class),
@ApiResponse(code = 401, message = "Authentication information is missing or invalid.", response = Void.class),
@ApiResponse(code = 403, message = "Access forbidden.", response = Void.class),
@ApiResponse(code = 404, message = "Requested resource is not found.", response = Error.class),
@ApiResponse(code = 500, message = "Internal server error.", response = Error.class),
@ApiResponse(code = 501, message = "Not Implemented.", response = Error.class)
})
public Response getSystemLocalAuthenticator(@ApiParam(value = "ID of an authenticator",required=true) @PathParam("authenticator-id") String authenticatorId, @Valid@ApiParam(value = "Condition to filter the retrieval of records. Only supports filtering based on the 'tag' and 'name' attribute. For local authenticators and request path authenticators, the 'displayName' is considered as the 'name' attribute during filtering. The 'name' attribute only supports 'eq' and 'sw operations. Filtering with multiple 'name' attributes is not supported. The 'tag' attribute only supports 'eq' operation. Filtering with multiple 'tag' attributes is supported with only 'or' as the complex query operation. E.g. /configs/authenticators?filter=name+sw+fi+and+(tag+eq+2FA+or+tag+eq+MFA) ") @QueryParam("filter") String filter, @Valid @Min(0)@ApiParam(value = "Maximum number of records to return. _<b>This option is not yet supported.<b>_ ") @QueryParam("limit") Integer limit, @Valid @Min(0)@ApiParam(value = "Number of records to skip for pagination. _<b>This option is not yet supported.<b>_ ") @QueryParam("offset") Integer offset) {

return delegate.getSystemLocalAuthenticator(authenticatorId, filter, limit, offset );
}

@Valid
@PATCH
@Path("/system/{authenticator-id}")
@Consumes({ "application/json" })
@Produces({ "application/json" })
@ApiOperation(value = "Update the system local authenticators ", notes = "Update the system local authenticators." +
" Currently only supports updating the AMR value. ", response = Authenticator.class, authorizations = {
@Authorization(value = "BasicAuth"),
@Authorization(value = "OAuth2", scopes = {

})
}, tags = { "System Local Authenticators", })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "Successful response", response = Authenticator.class),
@ApiResponse(code = 400, message = "Bad Request", response = Error.class),
@ApiResponse(code = 401, message = "Unauthorized", response = Void.class),
@ApiResponse(code = 403, message = "Forbidden", response = Void.class),
@ApiResponse(code = 500, message = "Server Error", response = Error.class)
})
public Response updateSystemLocalAuthenticatorAmrValueById(
@ApiParam(value = "ID of an authenticator", required = true)
@PathParam("authenticator-id") String authenticatorId,
@ApiParam(value = "This represents the system defined local authenticator to be created." , required = true)
@Valid SystemLocalAuthenticatorUpdate systemLocalAuthenticatorUpdate) {

return delegate.updateSystemLocalAuthenticatorAmrValueById(authenticatorId, systemLocalAuthenticatorUpdate);
}

@Valid
@PUT
@Path("/custom/{authenticator-id}")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
/*
* Copyright (c) 2021, WSO2 LLC. (http://www.wso2.org) 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.
*/
* Copyright (c) 2021-2025, WSO2 LLC. (http://www.wso2.org) 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.api.server.authenticators.v1;

Expand All @@ -25,6 +25,7 @@
import org.wso2.carbon.identity.api.server.authenticators.v1.model.Authenticator;
import org.wso2.carbon.identity.api.server.authenticators.v1.model.ConnectedApps;
import org.wso2.carbon.identity.api.server.authenticators.v1.model.Error;
import org.wso2.carbon.identity.api.server.authenticators.v1.model.SystemLocalAuthenticatorUpdate;
import org.wso2.carbon.identity.api.server.authenticators.v1.model.UserDefinedLocalAuthenticatorCreation;
import org.wso2.carbon.identity.api.server.authenticators.v1.model.UserDefinedLocalAuthenticatorUpdate;
import javax.ws.rs.core.Response;
Expand All @@ -42,5 +43,11 @@ public interface AuthenticatorsApiService {

public Response getConnectedAppsOfLocalAuthenticator(String authenticatorId, Integer limit, Integer offset);

public Response getSystemLocalAuthenticator(String authenticatorId, String filter, Integer limit, Integer offset);

public Response updateSystemLocalAuthenticatorAmrValueById(String authenticatorId
, SystemLocalAuthenticatorUpdate systemLocalAuthenticatorUpdate);

public Response updateUserDefinedLocalAuthenticator(String authenticatorId, UserDefinedLocalAuthenticatorUpdate userDefinedLocalAuthenticatorUpdate);

Comment thread
Eranda2001 marked this conversation as resolved.
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021-2025, WSO2 LLC. (http://www.wso2.com).
* Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com).
Comment thread
Eranda2001 marked this conversation as resolved.
*
* WSO2 LLC. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
/*
* Copyright (c) 2021, WSO2 LLC. (http://www.wso2.org) 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.
*/
* Copyright (c) 2021-2025, WSO2 LLC. (http://www.wso2.org) 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.api.server.authenticators.v1.model;

Expand Down Expand Up @@ -70,6 +70,7 @@ public static DefinedByEnum fromValue(String value) {
}

private DefinedByEnum definedBy;
private String amrValue;

@XmlType(name="TypeEnum")
@XmlEnum(String.class)
Expand Down Expand Up @@ -200,6 +201,24 @@ public void setDefinedBy(DefinedByEnum definedBy) {
this.definedBy = definedBy;
}

/**
**/
public Authenticator amrValue(String amrValue) {

this.amrValue = amrValue;
return this;
}

@ApiModelProperty(example = "basic", value = "")
@JsonProperty("amrValue")
@Valid
public String getAmrValue() {
return amrValue;
}
public void setAmrValue(String amrValue) {
this.amrValue = amrValue;
}

/**
**/
public Authenticator type(TypeEnum type) {
Expand Down Expand Up @@ -315,6 +334,7 @@ public boolean equals(java.lang.Object o) {
Objects.equals(this.displayName, authenticator.displayName) &&
Objects.equals(this.isEnabled, authenticator.isEnabled) &&
Objects.equals(this.definedBy, authenticator.definedBy) &&
Objects.equals(this.amrValue, authenticator.amrValue) &&
Objects.equals(this.type, authenticator.type) &&
Objects.equals(this.image, authenticator.image) &&
Objects.equals(this.description, authenticator.description) &&
Expand All @@ -324,7 +344,7 @@ public boolean equals(java.lang.Object o) {

@Override
public int hashCode() {
return Objects.hash(id, name, displayName, isEnabled, definedBy, type, image, description, tags, self);
return Objects.hash(id, name, displayName, isEnabled, definedBy, amrValue, type, image, description, tags, self);
}

@Override
Expand All @@ -338,6 +358,7 @@ public String toString() {
sb.append(" displayName: ").append(toIndentedString(displayName)).append("\n");
sb.append(" isEnabled: ").append(toIndentedString(isEnabled)).append("\n");
sb.append(" definedBy: ").append(toIndentedString(definedBy)).append("\n");
sb.append(" amrValue: ").append(toIndentedString(amrValue)).append("\n");
sb.append(" type: ").append(toIndentedString(type)).append("\n");
sb.append(" image: ").append(toIndentedString(image)).append("\n");
sb.append(" description: ").append(toIndentedString(description)).append("\n");
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
/*
* Copyright (c) 2025, WSO2 LLC. (http://www.wso2.com).
*
* WSO2 LLC. licenses this file to you 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.api.server.authenticators.v1.model;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.*;

/**
* Update the system authenticator AMR Value
Comment thread
Eranda2001 marked this conversation as resolved.
**/

import io.swagger.annotations.*;
import java.util.Objects;
import javax.validation.Valid;
import javax.xml.bind.annotation.*;
@ApiModel(description = "Update the system authenticator AMR Value")
public class SystemLocalAuthenticatorUpdate {

private String amrValue;

/**
**/
public SystemLocalAuthenticatorUpdate amrValue(String amrValue) {

this.amrValue = amrValue;
return this;
}

@ApiModelProperty(example = "basic", required = true, value = "")
@JsonProperty("amrValue")
@Valid
@NotNull(message = "Property amrValue cannot be null.")

public String getAmrValue() {
return amrValue;
}
public void setAmrValue(String amrValue) {
this.amrValue = amrValue;
}


Comment thread
Eranda2001 marked this conversation as resolved.

@Override
public boolean equals(java.lang.Object o) {

if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
SystemLocalAuthenticatorUpdate systemLocalAuthenticatorUpdate = (SystemLocalAuthenticatorUpdate) o;
return Objects.equals(this.amrValue, systemLocalAuthenticatorUpdate.amrValue);
}

@Override
public int hashCode() {
Comment thread
Eranda2001 marked this conversation as resolved.
return Objects.hash(amrValue);
}

@Override
public String toString() {

StringBuilder sb = new StringBuilder();
sb.append("class SystemLocalAuthenticatorUpdate {\n");

sb.append(" amrValue: ").append(toIndentedString(amrValue)).append("\n");
sb.append("}");
return sb.toString();
}

/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {

if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n");
}
}

Loading