Commit graph

24 commits

Author SHA1 Message Date
Nick Steel 4f9151c642
Credentials with access token (oauth) (#1309)
* core: Create credentials from access token via OAuth2

* core: Credentials.username is optional: not required for token auth.

* core: store auth data within session. We might need this later if need to re-auth and original creds are no longer valid/available.

* bin: New --token arg for using Spotify access token. Specify 0 to manually enter the auth code (headless).

* bin: Added --enable-oauth / -j option. Using --password / -p option will error and exit.

* core: reconnect session if using token authentication

Token authenticated sessions cannot use keymaster. So reconnect using the reusable credentials we just obtained. Can perhaps remove this
workaround once keymaster is replaced with login5.

* examples: replace password login with token login
2024-09-13 07:35:55 +02:00
Roderick van Domburg a60d63637d
Fix example 2022-08-03 22:50:21 +02:00
Daniel M 176a47f10f Return iterators instead of collected vecs
- Change the return type of metadata convenience iter functions to
  actual iterators instead of allocated collections
- The iterator item type is set to be a reference
2022-08-03 16:43:30 +02:00
Roderick van Domburg 05b9b13cf8
Merge branch 'dev' into new-api and update crates 2022-07-27 23:31:11 +02:00
Louis Seubert 6c2491b9a3
adding callback for reusable credentials (#983)
This allows more control over how the credentials are saved to the cache
2022-05-20 12:53:44 +02:00
Jason Gray 47f1362453
Port remove unsafe code and catch up with dev (#956) 2022-02-14 12:15:19 +01:00
Roderick van Domburg 2065ded7b6
Fix examples 2022-01-16 01:29:50 +01:00
Johan Förberg 5e8e2ba8c5 examples/playlist_tracks: Use normal URI parser 2022-01-11 19:29:38 +01:00
Roderick van Domburg 87f6a78d3e
Fix examples 2021-12-07 23:52:34 +01:00
johannesd3 041f084d7f Fix warnings 2021-05-13 22:42:55 +02:00
johannesd3 11ce29077e Fix formatting 2021-04-09 10:45:48 +02:00
ThouCheese ec1ec59b8a update examples
Re-add default impl to SessionConfig and make Credentials::with_password generic over Into<String>

add docs for Credential

reintroduce old Default impl for SessionConfig

use the third argument for the track-to-play rather than a testing id
2021-03-24 01:14:44 +01:00
marcelbuesing 38d82f2dc2
Rerun rustfmt on full codebase 2020-01-17 18:47:30 +01:00
marcelbuesing be2ad9059a
Migrate to rust 2018 edition 2020-01-17 15:54:42 +01:00
HEnquist c530ee6e82 Some more cleaning 2019-12-16 09:57:59 +01:00
HEnquist e1322474fa Clean up playlist example 2019-12-16 09:57:59 +01:00
HEnquist 9468ab7eec Remove unused code from example 2019-12-16 09:57:59 +01:00
HEnquist e6295a6f9c Use new hm endpoint for playlists 2019-12-16 09:57:59 +01:00
HEnquist 9faaaae6d2 Add basic support for playlists 2019-12-16 09:57:59 +01:00
HEnquist abd6ad6b25 Some more cleaning 2019-12-16 09:57:59 +01:00
HEnquist abfcce282e Clean up playlist example 2019-12-16 09:57:59 +01:00
HEnquist ae0585eb5b Remove unused code from example 2019-12-16 09:51:43 +01:00
HEnquist d8fda8f79c Use new hm endpoint for playlists 2019-12-16 09:51:43 +01:00
HEnquist 5b26529811 Add basic support for playlists 2019-12-16 09:51:43 +01:00