Skip to content

Commit

Permalink
Add refresh token (#7)
Browse files Browse the repository at this point in the history
* Add refresh token
* Don't encode private key in proof of possession header

---------

Co-authored-by: Jacob <[email protected]>
  • Loading branch information
justAnIdentity and cobward authored Jul 7, 2023
1 parent fa37092 commit 1360dce
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/proof_of_possession.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,12 @@ impl ProofOfPossession {
let (h_kid, h_jwk) = match (self.controller.vm.clone(), jwk.key_id.clone()) {
(Some(did), _) => (Some(did), None),
(None, Some(kid)) => (Some(kid), None),
(None, None) => (None, Some(jwk)),
(None, None) => (None, Some(jwk.to_public())),
};
let header = Header {
algorithm: alg,
key_id: h_kid,
jwk: h_jwk.cloned(),
jwk: h_jwk,
type_: Some(JWS_TYPE.to_string()),
..Default::default()
};
Expand Down
7 changes: 7 additions & 0 deletions src/token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ pub enum Request {
#[serde(alias = "pin")]
user_pin: Option<String>,
},
#[serde(rename = "urn:ietf:params:oauth:grant-type:refresh_token")]
RefreshToken {
client_id: Option<ClientId>,
refresh_token: String,
#[serde(alias = "pin")]
user_pin: Option<String>,
},
}

#[derive(Debug, Default, Deserialize, Serialize)]
Expand Down

0 comments on commit 1360dce

Please sign in to comment.