1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
//! Authentication types for OAuth and JWT.
//!
//! This module contains types for handling authentication responses from Deezer's
//! login endpoints, including:
//!
//! * OAuth authentication responses
//! - Access tokens for API access
//! - Token expiration information
//!
//! * JWT authentication
//! - ARL (Advanced Request Log) tokens
//! - Account identification
//!
//! # Example OAuth Response
//!
//! ```json
//! {
//! "access_token": "secret_token",
//! "expire": 0,
//! "expires": 0
//! }
//! ```
//!
//! # Example JWT Payload
//!
//! ```json
//! {
//! "arl": "secret_arl_token",
//! "account_id": "12345"
//! }
//! ```
//!
//! # Authentication Flow
//!
//! 1. Initial login provides OAuth access token
//! 2. Access token used to obtain JWT with ARL
//! 3. ARL stored as cookie for persistent authentication
//! 4. JWT renewed automatically before expiration
//!
//! # Note
//!
//! While the OAuth response includes expiration fields, Deezer currently returns 0
//! for both `expire` and `expires`. Token expiration is handled through JWT renewal
//! and cookie management instead.
use ;
use ;
use ;
use Redact;
/// User authentication data from OAuth login.
///
/// Contains the access token and timing information needed
/// to maintain an authenticated session.
/// JWT payload for persistent authentication.
///
/// Contains the tokens and identifiers needed to maintain a persistent
/// authenticated session across client restarts.
///
/// The ARL token is stored as a cookie and automatically renewed
/// before expiration to maintain the session.