Struct postgres_protocol::authentication::sasl::ScramSha256 [] [src]

pub struct ScramSha256 { /* fields omitted */ }

A type which handles the client side of the SCRAM-SHA-256 authentication process.

During the authentication process, if the backend sends an AuthenticationSASL message which includes SCRAM-SHA-256 as an authentication mechanism, this type can be used.

After a ScramSha256 is constructed, the buffer returned by the message() method should be sent to the backend in a SASLInitialResponse message along with the mechanism name.

The server will reply with an AuthenticationSASLContinue message. Its contents should be passed to the update() method, after which the buffer returned by the message() method should be sent to the backend in a SASLResponse message.

The server will reply with an AuthenticationSASLFinal message. Its contents should be passed to the finish() method, after which the authentication process is complete.

Methods

impl ScramSha256
[src]

[src]

Constructs a new instance which will use the provided password for authentication.

[src]

Returns the message which should be sent to the backend in an SASLResponse message.

[src]

Updates the state machine with the response from the backend.

This should be called when an AuthenticationSASLContinue message is received.

[src]

Finalizes the authentication process.

This should be called when the backend sends an AuthenticationSASLFinal message. Authentication has only succeeded if this method returns Ok(()).