dobecad / mal-rs

MyAnimeList API library written in Rust
https://docs.rs/mal-api/latest/mal_api/
MIT License
5 stars 0 forks source link

Support Oauth with public client + PKCE and alternative ways to load and store oauth information #1

Closed bbb651 closed 6 months ago

bbb651 commented 6 months ago

I'm trying to build a desktop application that uses this crate with oauth, and I was confused as to how I'm supposed to keep a client secret on the client. I'm not very familiar with oauth, so I looked it up and I found this question which pointed me to public/confidential client types and PKCE.

I think this crate should support this type of use-case and offer support for public client + PKCE in the oauth module.

In addition to that, currently the oauth module reads directly from environment variables and writes directly to a predefined config location. This is probably fine for a server environment, but for a desktop application it's not ideal, setting the environment variables is unnecessary and reading/writing to a config shouldn't be separated rest of the application config file or shared between multiple applications using this crate. Also the predefined location does not follow the xdg basedir specification

dobecad commented 6 months ago

Sure! I believe these changes make sense