-
-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Auth Customization Options #159
Conversation
…ith_custom_client_id`
* I got carried away, and made scope also customizable, later realized no customization is needed.
This is great, but you are missing two important options:
If you are using your own ClientID, these changes are also mandatory. Otherwise this option is useless. I saw that you added a custom scope, but then removed it as it was apparently not needed? What is the reason for this? - d2bb6f4 |
I removed the custom scope because that time i thought, that modifying permissions might not be required but rethinking it now, i realize that how can this be useful. Like you liquidboune I will add custom scope and RpsTicket format and commit the changes |
I just looked trough it an saw a lot of parameters with &'static str, and to my knowledge getting somethink as an &'static is not really possible (unless with a hardcoded str in this case) without leaking memory. Maybe using a non 'static str here is better? |
Meant fields in the AuthOps struct mb |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for making this, I'm sorry for taking so long to get to it. This looks good, the main thing I think should be changed is using Option<&str>
instead of &str
for all the public functions that take a client_id and scope. I can resolve everything here tomorrow (I'm going to sleep after writing this) unless you want to.
By the way, I recommend you also run cargo fmt
to standardize the formatting on some of the code.
Co-authored-by: mat <27899617+mat-1@users.noreply.github.com>
What this PR adds?
This PR addresses and closes the issue #130. It introduces two new functions in
azalea_client::Account
:microsoft_with_custom_client_id_and_scope
with_microsoft_access_token_and_custom_client_id_and_scope
.This PR will allow the developer, to customize the
client_id
andscope
, or use the nintendo switch one. Also, some other functions inauth.rs
likerefresh_ms_auth_token
,get_ms_link_code
,interactive_get_ms_auth_token
, etc. are modified and takes some extra parameters now. See the changes inauth.rs
for more information.Backwards Compatibility?
The existing functions
microsoft
andwith_microsoft_access_token
will maintain their current functionality. However, their implementations have been refactored to depend on the new functionsmicrosoft_with_custom_client_id_and_scope
andwith_microsoft_access_token_and_custom_client_id_and_scope
to avoid code duplication and facilitate easier maintenance.