-
Notifications
You must be signed in to change notification settings - Fork 545
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add new authenticator configs for user defined auth extensions.
- Loading branch information
1 parent
020a81a
commit 44bf32f
Showing
7 changed files
with
168 additions
and
180 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
141 changes: 0 additions & 141 deletions
141
...org/wso2/carbon/identity/application/common/model/AuthenticatorEndpointConfiguration.java
This file was deleted.
Oops, something went wrong.
88 changes: 88 additions & 0 deletions
88
...wso2/carbon/identity/application/common/model/UserDefinedAuthenticatorEndpointConfig.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,88 @@ | ||
/* | ||
* Copyright (c) 2024, 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.application.common.model; | ||
|
||
import org.wso2.carbon.identity.action.management.model.Authentication; | ||
import org.wso2.carbon.identity.action.management.model.EndpointConfig; | ||
|
||
import java.util.Map; | ||
|
||
/** | ||
* The authenticator endpoint configuration model. | ||
*/ | ||
public class UserDefinedAuthenticatorEndpointConfig { | ||
|
||
private final EndpointConfig endpointConfig; | ||
|
||
private UserDefinedAuthenticatorEndpointConfig(UserDefinedAuthenticatorEndpointConfigBuilder builder) { | ||
|
||
endpointConfig = builder.endpointConfig; | ||
} | ||
|
||
public EndpointConfig getEndpointConfig() { | ||
|
||
return endpointConfig; | ||
} | ||
|
||
/** | ||
* UserDefinedAuthenticatorEndpointConfig builder. | ||
*/ | ||
public static class UserDefinedAuthenticatorEndpointConfigBuilder { | ||
|
||
private String uri; | ||
private String authenticationType; | ||
private Map<String, String> authenticationProperties; | ||
private EndpointConfig endpointConfig; | ||
|
||
public UserDefinedAuthenticatorEndpointConfigBuilder() { | ||
} | ||
|
||
public UserDefinedAuthenticatorEndpointConfigBuilder uri(String uri) { | ||
|
||
this.uri = uri; | ||
return this; | ||
} | ||
|
||
public UserDefinedAuthenticatorEndpointConfigBuilder authenticationProperties( | ||
Map<String, String> authentication) { | ||
|
||
this.authenticationProperties = authentication; | ||
return this; | ||
} | ||
|
||
public UserDefinedAuthenticatorEndpointConfigBuilder authenticationType(String authenticationType) { | ||
|
||
this.authenticationType = authenticationType; | ||
return this; | ||
} | ||
|
||
public UserDefinedAuthenticatorEndpointConfig build() { | ||
|
||
EndpointConfig.EndpointConfigBuilder endpointConfigBuilder = new EndpointConfig.EndpointConfigBuilder(); | ||
endpointConfigBuilder.uri(uri); | ||
endpointConfigBuilder.authentication(new Authentication.AuthenticationBuilder() | ||
.type(Authentication.Type.valueOf(authenticationType)) | ||
.properties(authenticationProperties) | ||
.build()); | ||
endpointConfig = endpointConfigBuilder.build(); | ||
|
||
return new UserDefinedAuthenticatorEndpointConfig(this); | ||
} | ||
} | ||
} |
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
Oops, something went wrong.