Can initiate code authentication without client secret

This commit is contained in:
2025-02-21 14:49:45 +01:00
parent a73ad4bf41
commit d01311abf1
2 changed files with 11 additions and 19 deletions

@ -7,12 +7,6 @@ use std::collections::HashMap;
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize, Eq, PartialEq)]
pub struct ClientID(pub String);
#[derive(Debug, Copy, Clone, Eq, PartialEq)]
pub enum AuthenticationFlow {
AuthorizationCode,
Implicit,
}
pub type AdditionalClaims = HashMap<String, Value>;
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)]
@ -61,12 +55,9 @@ impl PartialEq for Client {
impl Eq for Client {}
impl Client {
/// Get the client authentication flow
pub fn auth_flow(&self) -> AuthenticationFlow {
match self.secret {
None => AuthenticationFlow::Implicit,
Some(_) => AuthenticationFlow::AuthorizationCode,
}
/// Check if the client has a secret defined
pub fn has_secret(&self) -> bool {
self.secret.is_some()
}
/// Process a single claim value