I am writing application authentication logic. At some point in the process method, I need to ask the user to select the values that were received.
How can I redirect it to the selection page I created in OpenAm? Also where should this page be located in openAM? How can I pass to this page the necessary values for the user to select?
Ty
This is my module:
<ModuleProperties moduleName="MyAuth" version="1.0" >
<Callbacks length="0" order="1" timeout="600" header="#NOT SHOWN#" template="readme.html"/>
<Callbacks length="2" order="2" timeout="600" header="#TO BE SUBSTITUTED#" template="readme.html">
<NameCallback isRequired="true" >
<Prompt>Username</Prompt>
</NameCallback>
<PasswordCallback echoPassword="false" >
<Prompt>Password</Prompt>
</PasswordCallback>
</Callbacks>
</ModuleProperties>
This my class MyAuth:
public class MyAuth extends AMLoginModule {
// same code here
@Override
public int process(Callback[] callbacks, int state) throws LoginException {
//same code logic here
switch (state) {
//...
case GET_TEMPLATE:
// in this place i try redirect to templete readme.html
Callback[] callback = getCallback(1);
try {
getCallbackHandler().handle(callback);
} catch (IOException e) {
e.printStackTrace();
} catch (UnsupportedCallbackException e) {
e.printStackTrace();
}
}
}
}
To retrieve additional input, add another state to the module.
Handle the state in the auth module code