Top Description Methods
io.undertow.security.api

public Interface NonceManager

Known Direct Subinterfaces
io.undertow.security.api.SessionNonceManager
Imports
io.undertow.server.HttpServerExchange

A NonceManager is used by the HTTP Digest authentication mechanism to request nonces and to validate the nonces sent from the client.
Author
Darran Lofthouse

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

The next nonce to be sent in a challenge to the client.
nextNonce
(final String
- The last valid nonce received from the client or null if we don't already have a nonce.
lastNonce
,
final HttpServerExchange exchange)

Select the next nonce to be sent from the server taking into account the last valid nonce.

public boolean

Returns:

true if the nonce can be used otherwise return false.
validateNonce
(final String
- The nonce received from the client.
nonce
,
final int
- The nonce count from the client or -1 of none specified.
nonceCount
,
final HttpServerExchange exchange)

Validate that a nonce can be used.

Method Detail

nextNonceback to summary
public String nextNonce(final String lastNonce, final HttpServerExchange exchange)

Select the next nonce to be sent from the server taking into account the last valid nonce. It is both possible and likely that the nonce last used by the client will still be valid, in that case the same nonce will be returned.

Parameters
lastNonce:String

- The last valid nonce received from the client or null if we don't already have a nonce.

Returns:String

The next nonce to be sent in a challenge to the client.

validateNonceback to summary
public boolean validateNonce(final String nonce, final int nonceCount, final HttpServerExchange exchange)

Validate that a nonce can be used. If the nonce can not be used but the related digest was correct then a new nonce should be returned to the client indicating that the nonce was stale. For implementations of this interface this method is not expected by be idempotent, i.e. once a nonce is validated with a specific nonceCount it is not expected that this method will return true again if the same combination is presented. This method is expected to ONLY be called if the users credentials are valid as a storage overhead could be incurred this overhead must not be accessible to unauthenticated clients.

Parameters
nonce:String

- The nonce received from the client.

nonceCount:int

- The nonce count from the client or -1 of none specified.

Returns:boolean

true if the nonce can be used otherwise return false.