Hi,

is it possible to pre-fill the username field on the login form using the 
OIDC protocol?
I had a look at the template and there is a parameter openIdLocalId which 
enables this.

I created and configured the following LoginDecorator-Groovy script and it 
works as expected when calling the login endpoint directly: 

def run(Object[] args) {
    def requestContext = args[0]
    def applicationContext = args[1]
    def logger = args[2]

    // Url parameter can not be 'username' because cas uses this parameter
    String usrName = requestContext.getRequestParameters().get("usrName")
    if(usrName != null) {
        logger.info("using preset username from request parameters: " + 
usrName)
        requestContext.getFlowScope().put("openIdLocalId", usrName)
    }
}

Unfortunately when using OIDC the clients never call the /login endpoint 
directly but instead first call the /authorize endpoint, which then 
internally redirects to the /login endpoint - where unfortunately the 
additional request parameter gets lost, rendering the script effect-less.
I scanned through the code, read the documentation and searched the web but 
I couldnt find any information about it, the name "openIdLocalId" may imply 
that it's got something to do with OIDC but I really cannot figure out how 
to do it.

If there is another way to achieve this I would be happy to learn about it!

The usecase is that a client application requests the user to enter its 
username and then decides depending on this to which IdP ( i.e. there are 
multiple) the user will be redirected, the user shouldnt be required to 
enter his username again after the re-direct to the IdP.

Thanks and best regards,
christian

-- 
- Website: https://apereo.github.io/cas
- Gitter Chatroom: https://gitter.im/apereo/cas
- List Guidelines: https://goo.gl/1VRrw7
- Contributions: https://goo.gl/mh7qDG
--- 
You received this message because you are subscribed to the Google Groups "CAS 
Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/a/apereo.org/d/msgid/cas-user/c36ea69f-e0f7-4e66-b55a-a6a09ad356c3n%40apereo.org.

Reply via email to