flwr_oauth2/authentication

Types

The type of client authentication that should be used with the OAuth 2.0 Server. An OAuth 2.0 Server can support multiple kinds of client authentication. When the incorrect kind is used, the OAuth 2.0 Server will respond with an error. For the error information see RFC6749 Error Response.

pub type ClientAuthentication {
  ClientSecretBasic(
    client_id: common.ClientId,
    client_secret: common.Secret,
  )
  ClientSecretPost(
    client_id: common.ClientId,
    client_secret: common.Secret,
  )
  PublicAuthentication(client_id: common.ClientId)
  ClientAssertion(
    client_id: common.ClientId,
    client_assertion: String,
    client_assertion_type: String,
  )
}

Constructors

  • ClientSecretBasic(
      client_id: common.ClientId,
      client_secret: common.Secret,
    )

    Use this type if the OAuth 2.0 Server accepts HTTP Basic authentication, which sets the Authorization header in the HTTP request. For example:

    Authorization: Basic czZCaGRSa3F0Mzo3RmpmcDBaQnIxS3REUmJuZlZkbUl3
    
  • ClientSecretPost(
      client_id: common.ClientId,
      client_secret: common.Secret,
    )

    Use this type if the OAuth 2.0 Server accepts the credentials via a POST request. In that case the credentials are sent URL encoded. For example:

    client_id=asdf&client_secret=hjkl
    
  • PublicAuthentication(client_id: common.ClientId)

    Use this type if the client is public and there is no client secret to be included.

  • ClientAssertion(
      client_id: common.ClientId,
      client_assertion: String,
      client_assertion_type: String,
    )

    Use this type if the OAuth 2.0 Server accepts a JWT assertion for client authentication. See RFC7523 Section 2.2

Values

pub fn to_string(client_auth: ClientAuthentication) -> String
Search Document