Skip to content

Bug in OAuth2 First Login page not using prefilled username from OAuth2UserRecord #6690

@poikilotherm

Description

@poikilotherm

While playing with our new Jülich DATA Beta service, I discovered that the username set in the authentication provider is never used in the first login form. This should be changed.

image
image

Digging into the code. I set the field during auth:

OAuth2UserRecord getUserRecord(UserInfo userInfo) {
return new OAuth2UserRecord(
this.getId(),
userInfo.getSubject().getValue(),
userInfo.getPreferredUsername(),
null,

But the view is simply requesting the username attribute, which is never set in OAuth2FirstLoginPage.init():

<div class="col-sm-4">
<p:inputText id="username" styleClass="form-control" value="#{OAuth2FirstLoginPage.username}" validator="#{OAuth2FirstLoginPage.validateUserName}"/>
<p:message for="username" display="text"/>
</div>

As always most of the time: happy to contribute. This looks like it was not left out on purpose, so dunno if we need a trigger for UI team or just go ahead and fix it.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Important

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions