File tree Expand file tree Collapse file tree 2 files changed +13
-10
lines changed Expand file tree Collapse file tree 2 files changed +13
-10
lines changed Original file line number Diff line number Diff line change 1
1
<?php
2
-
3
2
$ config = [
4
3
//main endpont:
5
- "service " =>"__http ://SERVICE.ENDPOINT/__ " ,
6
- //oauth endpoint:
7
- "sso " =>"__http ://SERVICE.ENDPOINT/oauth__ " ,
8
- "client_id " =>"__CLIENT_ID__ " ,
9
- "client_secret " =>"__CLIENT_SECRET__ " ,
4
+ "service " =>"http ://sandbox.fanapium.com:8080/ " ,
5
+ " sso " => " http://sandbox.fanapium.com/oauth2/ " ,
6
+ "sso_service " =>"http ://sandbox.fanapium.com/ " ,
7
+ "client_id " =>"40f6433a961bc1aff11b5ba3 " ,
8
+ "client_secret " =>"9bf8077e " ,
10
9
//the url of where this app is deployed
11
- "home " =>"http://WHERE_THIS_CODE_DEPLOYED/ "
12
- ];
10
+ "home " =>"http://79.174.163.69/php-oauth-simple/ "
11
+ ];
12
+
13
+
14
+
15
+
Original file line number Diff line number Diff line change 3
3
session_start ();
4
4
$ _SESSION ['keylead_code ' ]=$ _GET ['code ' ];
5
5
6
- $ url = ' demo.fanapium.com:12594/oauth2 /token/ ' ;
6
+ $ url = $ config [ ' sso ' ]. ' /token/ ' ;
7
7
$ ch = curl_init ($ url );
8
8
$ fields = "client_id= {$ config ['client_id ' ]}&client_secret= {$ config ['client_secret ' ]}&code= {$ _GET ['code ' ]}&redirect_uri= {$ config ['home ' ]}return.php&grant_type=authorization_code " ;
9
9
curl_setopt ($ ch , CURLOPT_POSTFIELDS , $ fields );
16
16
$ _SESSION ['access_token ' ]= $ token ->access_token ;
17
17
$ _SESSION ['refresh_token ' ]= $ token ->refresh_token ;
18
18
19
- header ("Location: {$ config ['home ' ]}index.php " );
19
+ header ("Location: {$ config ['home ' ]}index.php " );
You can’t perform that action at this time.
0 commit comments