Package net.shibboleth.idp.plugin.authn.webauthn.context.navigate

# Class UsernameLookupFromHttpRequest

java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent
net.shibboleth.idp.plugin.authn.webauthn.context.navigate.UsernameLookupFromHttpRequest

All Implemented Interfaces:
  `Function<ProfileRequestContext,String>`, `Component`, `DestructableComponent`, `IdentifiableComponent`, `IdentifiedComponent`, `InitializableComponent`

@ThreadSafeAfterInit public class UsernameLookupFromHttpRequest extends AbstractIdentifiableInitializableComponent implements Function<ProfileRequestContext,String>
Extract a username from the HTTP request, returning `null` if not found.

## Field Summary

Fields
Modifier and Type
Field
Description
`private NonnullSupplier<HttpServletRequest>`
`httpServletRequestSupplier`
Supplier for the Current HTTP request, if available.
`private String`
`usernameFieldName`
Form parameter name to carry username.

## Constructor Summary

Constructors
Constructor
Description
`UsernameLookupFromHttpRequest()`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`String`
`apply(ProfileRequestContext prc)`
`HttpServletRequest`
`getHttpServletRequest()`
Get the current HTTP request if available.
`void`
`setHttpServletRequestSupplier(NonnullSupplier<HttpServletRequest> requestSupplier)`
Set the current HTTP request Supplier.
`void`
`setUsernameFieldName(String name)`
Sets the name of the form field to carry the username.

### Methods inherited from class net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent

`setId`

### Methods inherited from class net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent

`doInitialize, ensureId, getId, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException`

### Methods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent

`checkComponentActive, checkSetterPreconditions, destroy, doDestroy, initialize, isDestroyed, isInitialized`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface java.util.function.Function

`andThen, compose`

### Methods inherited from interface net.shibboleth.shared.component.IdentifiedComponent

`getId`

## Field Details

### usernameFieldName

@Nonnull @NotEmpty private String usernameFieldName
Form parameter name to carry username.

### httpServletRequestSupplier

@Nullable private NonnullSupplier<HttpServletRequest> httpServletRequestSupplier
Supplier for the Current HTTP request, if available.

## Constructor Details

### UsernameLookupFromHttpRequest

public UsernameLookupFromHttpRequest()
Constructor.

## Method Details

### getHttpServletRequest

@Nullable public HttpServletRequest getHttpServletRequest()
Get the current HTTP request if available.

Returns:
  current HTTP request

### setHttpServletRequestSupplier

public void setHttpServletRequestSupplier(@Nullable NonnullSupplier<HttpServletRequest> requestSupplier)
Set the current HTTP request Supplier.

Parameters:
  `requestSupplier` - Supplier for the current HTTP request

### setUsernameFieldName

public void setUsernameFieldName(@Nonnull String name)
Sets the name of the form field to carry the username.

Parameters:
  `name` - field name

### apply

public String apply(@Nullable ProfileRequestContext prc)

Specified by:
  `apply` in interface `Function<ProfileRequestContext,String>`