How to find referer of redirect to oauth client's callbackLaravel: API with OAuth 2.0how to handle laravel socialite “Missing authorization Exception”Laravel Passport Error - ServerException in RequestException.php line 107Laravel Passport API call code parameter nullMany questions about using Laravel PassportFacing issues while using two or more request with GuzzleHttp in laravelLaravel Guzzle Client Server synchronisationLaravel 5.6 passport Oauth Client CridentialsHow To Dynamically Request Access Token Using Passport And Laravelusing oauth in laravel gives Error: redirect_uri_mismatch
Oil draining out shortly after turbo hose detached/broke
Could a person damage a jet airliner - from the outside - with their bare hands?
Why do some devices use electrolytic capacitors instead of ceramics for small value components?
How far would a landing Airbus A380 go until it stops with no brakes?
Does putting salt first make it easier for attacker to bruteforce the hash?
The origin of the Russian proverb about two hares
Why did the World Bank set the global poverty line at $1.90?
Who is "He that flies" in Lord of the Rings?
How to write a convincing religious myth?
Why are MBA programs closing in the United States?
Use 1 9 6 2 in this order to make 75
Extracting data from Plot
To what extent do precedents in Westminster systems apply in other countries that use it?
Flat with smooth fibers implies formally smooth?
Can you make an identity from this product?
How and why do references in academic papers work?
Multiband vertical antenna not working as expected
NUL delimited variable
Why do radiation hardened IC packages often have long leads?
Why is the length of the Kelvin unit of temperature equal to that of the Celsius unit?
How can powerful telekinesis avoid violating Newton's 3rd Law?
How do we say "within a kilometer radius spherically"?
Trying to get (more) accurate readings from thermistor (electronics, math, and code inside)
Difference between prepositions in "...killed during/in the war"
How to find referer of redirect to oauth client's callback
Laravel: API with OAuth 2.0how to handle laravel socialite “Missing authorization Exception”Laravel Passport Error - ServerException in RequestException.php line 107Laravel Passport API call code parameter nullMany questions about using Laravel PassportFacing issues while using two or more request with GuzzleHttp in laravelLaravel Guzzle Client Server synchronisationLaravel 5.6 passport Oauth Client CridentialsHow To Dynamically Request Access Token Using Passport And Laravelusing oauth in laravel gives Error: redirect_uri_mismatch
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I am having trouble setting up a generic oauth client (and can't find good material on google).
I have this as my route to receive the callback from the oauth process:
Route::get('/oauth/callback', function (Request $request)
$http = new GuzzleHttpClient;
$response = $http->post('https://www.wunderlist.com/oauth/access_token', [
'client_id' => 'xxxxxxxxxxxxxxx',
'client_secret' => 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
'code' => $request->code
]);
);
but in order to make it generic, I must be able to identify where the redirect came from.
something in the lines of
$service = AppService::where(<field>, $request-><information about the referer>);
does Request contain any kind of information that can help me identify the source of the redirect? I looked at the object with dd()
and couldn't find anything
laravel
add a comment |
I am having trouble setting up a generic oauth client (and can't find good material on google).
I have this as my route to receive the callback from the oauth process:
Route::get('/oauth/callback', function (Request $request)
$http = new GuzzleHttpClient;
$response = $http->post('https://www.wunderlist.com/oauth/access_token', [
'client_id' => 'xxxxxxxxxxxxxxx',
'client_secret' => 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
'code' => $request->code
]);
);
but in order to make it generic, I must be able to identify where the redirect came from.
something in the lines of
$service = AppService::where(<field>, $request-><information about the referer>);
does Request contain any kind of information that can help me identify the source of the redirect? I looked at the object with dd()
and couldn't find anything
laravel
add a comment |
I am having trouble setting up a generic oauth client (and can't find good material on google).
I have this as my route to receive the callback from the oauth process:
Route::get('/oauth/callback', function (Request $request)
$http = new GuzzleHttpClient;
$response = $http->post('https://www.wunderlist.com/oauth/access_token', [
'client_id' => 'xxxxxxxxxxxxxxx',
'client_secret' => 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
'code' => $request->code
]);
);
but in order to make it generic, I must be able to identify where the redirect came from.
something in the lines of
$service = AppService::where(<field>, $request-><information about the referer>);
does Request contain any kind of information that can help me identify the source of the redirect? I looked at the object with dd()
and couldn't find anything
laravel
I am having trouble setting up a generic oauth client (and can't find good material on google).
I have this as my route to receive the callback from the oauth process:
Route::get('/oauth/callback', function (Request $request)
$http = new GuzzleHttpClient;
$response = $http->post('https://www.wunderlist.com/oauth/access_token', [
'client_id' => 'xxxxxxxxxxxxxxx',
'client_secret' => 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
'code' => $request->code
]);
);
but in order to make it generic, I must be able to identify where the redirect came from.
something in the lines of
$service = AppService::where(<field>, $request-><information about the referer>);
does Request contain any kind of information that can help me identify the source of the redirect? I looked at the object with dd()
and couldn't find anything
laravel
laravel
asked Mar 24 at 21:55
lipkaulipkau
83
83
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
You should use request()->headers->get('referer')
to check the referrer url.
I should have mentioned that. Sorry. The referer header has the address of my own page: ``` "referer" => array:1 [▼ 0 => "localhost:8000/home" ] ``` as my page redirects to the service, which redirects to my callback
– lipkau
Mar 25 at 14:43
add a comment |
I managed to work around the problem by defining the callback url so that it contains a query parameter identifying the service.
This means that I tell the service to callback to /oauth/callback?service=XXX
and I find it in my services table like this:
$service = Service::where('slug', Input::get('service'))->firstOrFail();
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55328951%2fhow-to-find-referer-of-redirect-to-oauth-clients-callback%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
You should use request()->headers->get('referer')
to check the referrer url.
I should have mentioned that. Sorry. The referer header has the address of my own page: ``` "referer" => array:1 [▼ 0 => "localhost:8000/home" ] ``` as my page redirects to the service, which redirects to my callback
– lipkau
Mar 25 at 14:43
add a comment |
You should use request()->headers->get('referer')
to check the referrer url.
I should have mentioned that. Sorry. The referer header has the address of my own page: ``` "referer" => array:1 [▼ 0 => "localhost:8000/home" ] ``` as my page redirects to the service, which redirects to my callback
– lipkau
Mar 25 at 14:43
add a comment |
You should use request()->headers->get('referer')
to check the referrer url.
You should use request()->headers->get('referer')
to check the referrer url.
edited Mar 25 at 11:09
answered Mar 25 at 1:16


sentysenty
4,233859141
4,233859141
I should have mentioned that. Sorry. The referer header has the address of my own page: ``` "referer" => array:1 [▼ 0 => "localhost:8000/home" ] ``` as my page redirects to the service, which redirects to my callback
– lipkau
Mar 25 at 14:43
add a comment |
I should have mentioned that. Sorry. The referer header has the address of my own page: ``` "referer" => array:1 [▼ 0 => "localhost:8000/home" ] ``` as my page redirects to the service, which redirects to my callback
– lipkau
Mar 25 at 14:43
I should have mentioned that. Sorry. The referer header has the address of my own page: ``` "referer" => array:1 [▼ 0 => "localhost:8000/home" ] ``` as my page redirects to the service, which redirects to my callback
– lipkau
Mar 25 at 14:43
I should have mentioned that. Sorry. The referer header has the address of my own page: ``` "referer" => array:1 [▼ 0 => "localhost:8000/home" ] ``` as my page redirects to the service, which redirects to my callback
– lipkau
Mar 25 at 14:43
add a comment |
I managed to work around the problem by defining the callback url so that it contains a query parameter identifying the service.
This means that I tell the service to callback to /oauth/callback?service=XXX
and I find it in my services table like this:
$service = Service::where('slug', Input::get('service'))->firstOrFail();
add a comment |
I managed to work around the problem by defining the callback url so that it contains a query parameter identifying the service.
This means that I tell the service to callback to /oauth/callback?service=XXX
and I find it in my services table like this:
$service = Service::where('slug', Input::get('service'))->firstOrFail();
add a comment |
I managed to work around the problem by defining the callback url so that it contains a query parameter identifying the service.
This means that I tell the service to callback to /oauth/callback?service=XXX
and I find it in my services table like this:
$service = Service::where('slug', Input::get('service'))->firstOrFail();
I managed to work around the problem by defining the callback url so that it contains a query parameter identifying the service.
This means that I tell the service to callback to /oauth/callback?service=XXX
and I find it in my services table like this:
$service = Service::where('slug', Input::get('service'))->firstOrFail();
answered Mar 31 at 20:54
lipkaulipkau
83
83
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55328951%2fhow-to-find-referer-of-redirect-to-oauth-clients-callback%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown