-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(jans-auth-server): add Token Exchange interception script #8157
Signed-off-by: YuriyZ <[email protected]>
- Loading branch information
Showing
3 changed files
with
64 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
46 changes: 46 additions & 0 deletions
46
...e/script/src/main/java/io/jans/model/custom/script/type/token/DummyTokenExchangeType.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,46 @@ | ||
package io.jans.model.custom.script.type.token; | ||
|
||
import io.jans.model.SimpleCustomProperty; | ||
import io.jans.model.custom.script.model.CustomScript; | ||
|
||
import java.util.Map; | ||
|
||
/** | ||
* @author Yuriy Z | ||
*/ | ||
public class DummyTokenExchangeType implements TokenExchangeType { | ||
@Override | ||
public boolean modifyResponse(Object context) { | ||
return false; | ||
} | ||
|
||
@Override | ||
public void validate(Object context) { | ||
// dummy | ||
} | ||
|
||
@Override | ||
public boolean skipBuiltinValidation(Object context) { | ||
return false; | ||
} | ||
|
||
@Override | ||
public boolean init(Map<String, SimpleCustomProperty> configurationAttributes) { | ||
return true; | ||
} | ||
|
||
@Override | ||
public boolean init(CustomScript customScript, Map<String, SimpleCustomProperty> configurationAttributes) { | ||
return true; | ||
} | ||
|
||
@Override | ||
public boolean destroy(Map<String, SimpleCustomProperty> configurationAttributes) { | ||
return true; | ||
} | ||
|
||
@Override | ||
public int getApiVersion() { | ||
return 1; | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
jans-core/script/src/main/java/io/jans/model/custom/script/type/token/TokenExchangeType.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,15 @@ | ||
package io.jans.model.custom.script.type.token; | ||
|
||
import io.jans.model.custom.script.type.BaseExternalType; | ||
|
||
/** | ||
* @author Yuriy Z | ||
*/ | ||
public interface TokenExchangeType extends BaseExternalType { | ||
|
||
boolean modifyResponse(Object context); | ||
|
||
void validate(Object context); | ||
|
||
boolean skipBuiltinValidation(Object context); | ||
} |