Retrieve access token from provider
This commit is contained in:
@@ -2,7 +2,9 @@ use std::path::{Path, PathBuf};
|
||||
|
||||
use clap::Parser;
|
||||
|
||||
use crate::constants::{APP_NAME, CLIENTS_LIST_FILE, PROVIDERS_LIST_FILE, USERS_LIST_FILE};
|
||||
use crate::constants::{
|
||||
APP_NAME, CLIENTS_LIST_FILE, OIDC_PROVIDER_CB_URI, PROVIDERS_LIST_FILE, USERS_LIST_FILE,
|
||||
};
|
||||
|
||||
/// Basic OIDC provider
|
||||
#[derive(Parser, Debug, Clone)]
|
||||
@@ -84,6 +86,12 @@ impl AppConfig {
|
||||
}
|
||||
}
|
||||
|
||||
/// Get the URL where a upstream OpenID provider should redirect
|
||||
/// the user after an authentication
|
||||
pub fn oidc_provider_redirect_url(&self) -> String {
|
||||
AppConfig::get().full_url(OIDC_PROVIDER_CB_URI)
|
||||
}
|
||||
|
||||
pub fn domain_name(&self) -> &str {
|
||||
self.website_origin.split('/').nth(2).unwrap_or(APP_NAME)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user