Add openid-connecter discovery route
This commit is contained in:
@ -3,4 +3,5 @@ pub mod base_controller;
|
||||
pub mod login_controller;
|
||||
pub mod settings_controller;
|
||||
pub mod admin_controller;
|
||||
pub mod admin_api;
|
||||
pub mod admin_api;
|
||||
pub mod openid_controller;
|
19
src/controllers/openid_controller.rs
Normal file
19
src/controllers/openid_controller.rs
Normal file
@ -0,0 +1,19 @@
|
||||
use actix_web::{HttpResponse, Responder, web};
|
||||
|
||||
use crate::data::app_config::AppConfig;
|
||||
use crate::data::openid_config::OpenIDConfig;
|
||||
|
||||
pub async fn get_configuration(app_conf: web::Data<AppConfig>) -> impl Responder {
|
||||
HttpResponse::Ok().json(OpenIDConfig {
|
||||
issuer: app_conf.full_url("/"),
|
||||
authorization_endpoint: app_conf.full_url("openid/authorize"),
|
||||
token_endpoint: app_conf.full_url("openid/token"),
|
||||
userinfo_endpoint: app_conf.full_url("openid/userinfo"),
|
||||
jwks_uri: app_conf.full_url("openid/jwks_uri"),
|
||||
scopes_supported: vec!["openid", "profile", "email"],
|
||||
response_types_supported: vec!["code", "id_token", "token id_token"],
|
||||
subject_types_supported: vec!["public"],
|
||||
id_token_signing_alg_values_supported: vec!["RS256"],
|
||||
claims_supported: vec!["sub", "exp", "name", "given_name", "family_name", "email"]
|
||||
})
|
||||
}
|
Reference in New Issue
Block a user