Content-Length: 234221 | pFad | https://github.com/sebadob/rauthy/commit/b57656ffaf7e822527d2d8c9d74b7c948193c220

2A Merge pull request #91 from sebadob/oidc-endpoints-allow-all-cors · sebadob/rauthy@b57656f · GitHub
Skip to content

Commit

Permalink
Merge pull request #91 from sebadob/oidc-endpoints-allow-all-cors
Browse files Browse the repository at this point in the history
allow CORS '*' on .well-known oidc endpoints and JWKS
  • Loading branch information
sebadob authored Oct 24, 2023
2 parents 8e97e31 + 2e0d7ee commit b57656f
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions rauthy-handlers/src/oidc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use std::ops::Add;
use std::time::{SystemTime, UNIX_EPOCH};

use actix_web::cookie::time::OffsetDateTime;
use actix_web::http::header::HeaderValue;
use actix_web::http::{header, StatusCode};
use actix_web::{get, post, web, HttpRequest, HttpResponse};
use actix_web_grants::proc_macro::{has_any_permission, has_permissions, has_roles};
Expand Down Expand Up @@ -244,7 +245,12 @@ pub async fn post_authorize_refresh(
pub async fn get_certs(data: web::Data<AppState>) -> Result<HttpResponse, ErrorResponse> {
let jwks = JWKS::find_pk(&data).await?;
let res = JWKSCerts::from(jwks);
Ok(HttpResponse::Ok().json(res))
Ok(HttpResponse::Ok()
.insert_header((
header::ACCESS_CONTROL_ALLOW_ORIGIN,
HeaderValue::from_str("*").unwrap(),
))
.json(res))
}

//github.com/ Single JWK by kid
Expand Down Expand Up @@ -655,5 +661,10 @@ pub async fn get_userinfo(
#[get("/.well-known/openid-configuration")]
#[has_permissions("all")]
pub async fn get_well_known(data: web::Data<AppState>) -> HttpResponse {
HttpResponse::Ok().json(&data.well_known)
HttpResponse::Ok()
.insert_header((
header::ACCESS_CONTROL_ALLOW_ORIGIN,
HeaderValue::from_str("*").unwrap(),
))
.json(&data.well_known)
}

0 comments on commit b57656f

Please sign in to comment.








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/sebadob/rauthy/commit/b57656ffaf7e822527d2d8c9d74b7c948193c220

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy