Skip to content

Commit 0737586

Browse files
committed
feature: enable accept-rfc-3339-timestamps in openidconnect-rs and
skip tokenhash validation to enable auth0 compatability
1 parent 6bc4793 commit 0737586

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

server/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

server/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,9 @@ utoipa = { version = "4.2", features = [
153153
"debug",
154154
] }
155155
utoipa-redoc = { version = "4.0", features = ["actix-web"] }
156-
openidconnect = { git = "https://github.com/devflowinc/openidconnect-rs.git", branch = "patch-3.4.0", features = [
156+
openidconnect = { git = "https://github.com/devflowinc/openidconnect-rs.git", rev = "9b9cefd91ae7e1bc4ad336a9bed5dcf04fa179a5", features = [
157157
"reqwest",
158+
"accept-rfc3339-timestamps"
158159
], default-features = false }
159160
oauth2 = "4.4.2"
160161
dateparser = "0.2.1"

server/src/handlers/auth_handler.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -453,14 +453,15 @@ pub async fn oidc_callback(
453453
.ok_or_else(|| ServiceError::InternalServerError("Empty ID Token".into()))?;
454454

455455
let id_token_verifier = oidc_client.id_token_verifier();
456-
let claims = id_token
457-
.claims(&id_token_verifier, &nonce)
458-
.map_err(|_| ServiceError::InternalServerError("Claims Verification Error".into()))?;
456+
let claims = id_token.claims(&id_token_verifier, &nonce).map_err(|e| {
457+
ServiceError::InternalServerError(format!("Claims Verification Error, {}", e))
458+
})?;
459459

460460
match claims.access_token_hash() {
461-
None => Err(ServiceError::BadRequest(
462-
"Missing access token hash".to_string(),
463-
))?,
461+
None => {
462+
log::warn!("Access Token Hash Not provided by openid provider, skipping hash check");
463+
Ok(())
464+
}
464465
Some(given_token_hash) => {
465466
let calculated_token_hash = AccessTokenHash::from_token(
466467
token_response.access_token(),

0 commit comments

Comments
 (0)