Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion server/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,9 @@ utoipa = { version = "4.2", features = [
"debug",
] }
utoipa-redoc = { version = "4.0", features = ["actix-web"] }
openidconnect = { git = "https://github.com/devflowinc/openidconnect-rs.git", branch = "patch-3.4.0", features = [
openidconnect = { git = "https://github.com/devflowinc/openidconnect-rs.git", rev = "9b9cefd91ae7e1bc4ad336a9bed5dcf04fa179a5", features = [
"reqwest",
"accept-rfc3339-timestamps"
], default-features = false }
oauth2 = "4.4.2"
dateparser = "0.2.1"
Expand Down
13 changes: 7 additions & 6 deletions server/src/handlers/auth_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -453,14 +453,15 @@ pub async fn oidc_callback(
.ok_or_else(|| ServiceError::InternalServerError("Empty ID Token".into()))?;

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

match claims.access_token_hash() {
None => Err(ServiceError::BadRequest(
"Missing access token hash".to_string(),
))?,
None => {
log::warn!("Access Token Hash Not provided by openid provider, skipping hash check");
Ok(())
}
Some(given_token_hash) => {
let calculated_token_hash = AccessTokenHash::from_token(
token_response.access_token(),
Expand Down
Loading