kilork / openid

OpenID Connect Rust Library
The Unlicense
63 stars 22 forks source link

Cannot save openId::Token to async_session::Session. #27

Closed hayaoR closed 2 years ago

hayaoR commented 2 years ago

I tried to save the openId::Token in async_session::Session, but I couldn't because the insert function of async_session::Session requires the implementation of Serialize, but openId::Token doesn't implement it.

Is it possible to implement Serialize in openId::Token?

https://docs.rs/async-session/3.0.0/async_session/struct.Session.html#method.insert https://docs.rs/openid/0.9.3/openid/struct.Token.html

kilork commented 2 years ago

Hi, you can use bearer field of openid::Token structure.

https://docs.rs/openid/0.9.3/openid/struct.Token.html#structfield.bearer

hayaoR commented 2 years ago

Thank you!

I didn't understand that I don't need to store ID token in the session.

kilork commented 2 years ago

Yeap, my favourite development principle is YAGNI :)