Skip to content

Commit c46ebd1

Browse files
committed
fix: add token type
1 parent 39d52d4 commit c46ebd1

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ serde_json = "1.0"
1919
serde_urlencoded = "0.7"
2020
reqwest = { version = "0.12", features = ["json"] }
2121
jsonwebtoken = "9.3.0"
22-
urlencoding = "2.1"
2322
oauth2 = "5.0.0-rc.1"
2423
toml = "0.8"
2524
openssl = "0.10.68"

src/authn/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ use jsonwebtoken::{
77
Algorithm, DecodingKey, TokenData, Validation,
88
};
99
pub use models::*;
10-
pub use oauth2::basic::BasicTokenIntrospectionResponse;
1110
use oauth2::{AccessToken, AuthUrl, AuthorizationCode, ClientId, ClientSecret, IntrospectionUrl, RedirectUrl, RefreshToken, TokenUrl};
1211
use openssl::{
1312
base64,
@@ -16,6 +15,7 @@ use openssl::{
1615
};
1716
use rand::Rng;
1817
use std::{fmt::Write, iter};
18+
pub use oauth2::{basic::BasicTokenIntrospectionResponse, TokenIntrospectionResponse};
1919
use url::Url;
2020
use uuid::Uuid;
2121

src/authn/models.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use std::time::Duration;
22

33
use crate::{Model, User};
4-
use anyhow::{Error, Ok, Result};
4+
use anyhow::{Ok, Result};
55
pub use oauth2::TokenResponse;
66
use oauth2::{
77
basic::{BasicErrorResponse, BasicRevocationErrorResponse, BasicTokenIntrospectionResponse, BasicTokenType},
@@ -63,7 +63,7 @@ impl ExtraTokenFields for CasdoorExtraTokenFields {}
6363

6464
#[derive(Debug, Deserialize, Serialize)]
6565
pub struct CasdoorExtraTokenFields {
66-
// This field only use in OpenID Connect
66+
/// This field only use in OpenID Connect
6767
pub id_token: String,
6868
}
6969

@@ -201,6 +201,7 @@ impl OAuth2Client {
201201
.set_auth_type(AuthType::BasicAuth)
202202
.set_introspection_url(intro_url)
203203
.introspect(token)
204+
.set_token_type_hint("access_token")
204205
.request_async(&self.http_client)
205206
.await?;
206207

0 commit comments

Comments
 (0)