@@ -35,60 +35,60 @@ protected function getTokenUrl(): string
35
35
return 'https://developer.api.autodesk.com/authentication/v2/token ' ;
36
36
}
37
37
38
- /**
39
- * {@inheritdoc}
40
- */
41
- protected function getCodeFields ($ state = null )
42
- {
43
- $ fields = [
44
- 'client_id ' => $ this ->getConfig ('client_id ' ) ?? $ this ->clientId ,
45
- 'redirect_uri ' => $ this ->getConfig ('redirect ' ) ?? $ this ->redirectUrl ,
46
- 'scope ' => $ this ->formatScopes ($ this ->getScopes (), $ this ->scopeSeparator ),
47
- 'response_type ' => 'code ' ,
48
- ];
49
-
50
- if ($ this ->usesState ()) {
51
- $ fields ['state ' ] = $ state ;
52
- }
53
-
54
- if ($ this ->usesPKCE ()) {
55
- $ fields ['code_challenge ' ] = $ this ->getCodeChallenge ();
56
- $ fields ['code_challenge_method ' ] = $ this ->getCodeChallengeMethod ();
57
- }
58
-
59
- return array_merge ($ fields , $ this ->parameters );
60
- }
61
-
62
- /**
63
- * {@inheritdoc}
64
- */
65
- protected function getTokenFields ($ code )
66
- {
67
- $ fields = [
68
- 'grant_type ' => 'authorization_code ' ,
69
- 'code ' => $ code ,
70
- 'redirect_uri ' => $ this ->getConfig ('redirect ' ) ?? $ this ->redirectUrl ,
71
- ];
72
-
73
- if ($ this ->usesPKCE ()) {
74
- $ fields ['code_verifier ' ] = $ this ->request ->session ()->pull ('code_verifier ' );
75
- }
76
-
77
- return array_merge ($ fields , $ this ->parameters );
78
- }
79
-
80
-
81
- /**
82
- * {@inheritdoc}
83
- */
84
- protected function getTokenHeaders ( $ code ): array
85
- {
86
- $ base64 = base64_encode (( $ this -> getConfig ( ' client_id ' ) ?? $ this -> clientId ). ' : ' .( $ this -> getConfig ( ' client_secret ' ) ?? $ this -> clientSecret ));
87
- return [
88
- 'Content-Type ' => 'application/x-www-form-urlencoded ' ,
89
- 'Authorization ' => 'Basic ' .$ base64 ,
90
- ];
91
- }
38
+ /**
39
+ * {@inheritdoc}
40
+ */
41
+ protected function getCodeFields ($ state = null )
42
+ {
43
+ $ fields = [
44
+ 'client_id ' => $ this ->getConfig ('client_id ' ) ?? $ this ->clientId ,
45
+ 'redirect_uri ' => $ this ->getConfig ('redirect ' ) ?? $ this ->redirectUrl ,
46
+ 'scope ' => $ this ->formatScopes ($ this ->getScopes (), $ this ->scopeSeparator ),
47
+ 'response_type ' => 'code ' ,
48
+ ];
49
+
50
+ if ($ this ->usesState ()) {
51
+ $ fields ['state ' ] = $ state ;
52
+ }
53
+
54
+ if ($ this ->usesPKCE ()) {
55
+ $ fields ['code_challenge ' ] = $ this ->getCodeChallenge ();
56
+ $ fields ['code_challenge_method ' ] = $ this ->getCodeChallengeMethod ();
57
+ }
58
+
59
+ return array_merge ($ fields , $ this ->parameters );
60
+ }
61
+
62
+ /**
63
+ * {@inheritdoc}
64
+ */
65
+ protected function getTokenFields ($ code )
66
+ {
67
+ $ fields = [
68
+ 'grant_type ' => 'authorization_code ' ,
69
+ 'code ' => $ code ,
70
+ 'redirect_uri ' => $ this ->getConfig ('redirect ' ) ?? $ this ->redirectUrl ,
71
+ ];
72
+
73
+ if ($ this ->usesPKCE ()) {
74
+ $ fields ['code_verifier ' ] = $ this ->request ->session ()->pull ('code_verifier ' );
75
+ }
76
+
77
+ return array_merge ($ fields , $ this ->parameters );
78
+ }
79
+
80
+ /**
81
+ * {@inheritdoc}
82
+ */
83
+ protected function getTokenHeaders ( $ code ): array
84
+ {
85
+ $ base64 = base64_encode (( $ this -> getConfig ( ' client_id ' ) ?? $ this -> clientId ). ' : ' .( $ this -> getConfig ( ' client_secret ' ) ?? $ this -> clientSecret ));
86
+
87
+ return [
88
+ 'Content-Type ' => 'application/x-www-form-urlencoded ' ,
89
+ 'Authorization ' => 'Basic ' .$ base64 ,
90
+ ];
91
+ }
92
92
93
93
/**
94
94
* @param string $token
@@ -118,7 +118,7 @@ protected function getUserByToken($token): array
118
118
*/
119
119
protected function mapUserToObject (array $ user ): User
120
120
{
121
- return (new User () )->setRaw ($ user )->map ([
121
+ return (new User )->setRaw ($ user )->map ([
122
122
'id ' => $ user ['sub ' ],
123
123
'email ' => $ user ['email ' ],
124
124
'email_verified ' => $ user ['email_verified ' ],
0 commit comments