Package net.shibboleth.idp.authn.context

# Class UsernamePasswordContext

java.lang.Object
org.opensaml.messaging.context.BaseContext
net.shibboleth.idp.authn.context.UsernamePasswordContext

All Implemented Interfaces:
  `Iterable<BaseContext>`

public final class UsernamePasswordContext extends BaseContext
Context that carries a username/password pair to be validated.

Parent:
  `AuthenticationContext`
Added:
  After extracting a username/password pair during authentication

## Nested Class Summary

## Nested classes/interfaces inherited from class org.opensaml.messaging.context.BaseContext

`BaseContext.ContextSetNoRemoveIteratorDecorator, BaseContext.DeprecatedContextClassNameLookAside`

## Field Summary

Fields
Modifier and Type
Field
Description
`private String`
`password`
The password associated with the username.
`private String`
`transformedUsername`
The transformed username.
`private String`
`username`
The original username.

## Constructor Summary

Constructors
Constructor
Description
`UsernamePasswordContext()`

## Method Summary

Modifier and Type
Method
Description
`String`
`getPassword()`
Gets the password associated with the username.
`String`
`getTransformedUsername()`
Gets the transformed username after undergoing some kind of reformatting or normalization.
`String`
`getUsername()`
Gets the username.
`UsernamePasswordContext`
`setPassword(String pass)`
Sets the password associated with the username.
`UsernamePasswordContext`
`setTransformedUsername(String name)`
Sets the transformed username.
`UsernamePasswordContext`
`setUsername(String name)`
Sets the username and resets the transformed version to be identical.

### Methods inherited from class org.opensaml.messaging.context.BaseContext

`addSubcontext, addSubcontext, clearSubcontexts, containsSubcontext, createSubcontext, ensureSubcontext, ensureSubcontext, getParent, getSubcontext, getSubcontext, getSubcontext, getSubcontext, iterator, removeFromParent, removeSubcontext, removeSubcontext, setParent`

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

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

### Methods inherited from interface java.lang.Iterable

`forEach, spliterator`

## Field Details

### username

@Nullable private String username
The original username.

### transformedUsername

@Nullable private String transformedUsername
The transformed username.

### password

@Nullable private String password
The password associated with the username.

## Constructor Details

### UsernamePasswordContext

public UsernamePasswordContext()

## Method Details

### getUsername

@Nullable public String getUsername()
Gets the username.

Returns:
  the username

### setUsername

@Nonnull public UsernamePasswordContext setUsername(@Nullable String name)
Sets the username and resets the transformed version to be identical.

Parameters:
  `name` - the username
Returns:
  this context

### getTransformedUsername

@Nullable public String getTransformedUsername()
Gets the transformed username after undergoing some kind of reformatting or normalization.

Returns:
  the transformed username
Since:
  4.0.0

### setTransformedUsername

@Nonnull public UsernamePasswordContext setTransformedUsername(@Nullable String name)
Sets the transformed username.

Parameters:
  `name` - the username
Returns:
  this context
Since:
  4.0.0

### getPassword

@Nullable public String getPassword()
Gets the password associated with the username.

Returns:
  password associated with the username

### setPassword

@Nonnull public UsernamePasswordContext setPassword(@Nullable String pass)
Sets the password associated with the username.

Parameters:
  `pass` - password associated with the username
Returns:
  this context