OpenID check_authentication not working - php

Merged with OpenID check_authentication not working.
I'm trying to write my own provider in PHP (JanRain libraries are confusing as all hell, and even phpMyID doesn't document exactly what is happening). I've got authentication working, but when the relying party tries to do check_authentication, it says my server denied it.
This is debugging information I captured during a check_authentication request.
$_GET:
Array
(
[mode] => profile
[username] => jrhodes
[domain] => roket-enterprises.com
)
$_POST:
Array
(
[openid_assoc_handle] => {HMAC-SHA1}{4abdf2f1}{olw8ag==}
[openid_identity] => http://www.roket-enterprises.com/openaccount/openid:jrhodes
[openid_mode] => check_authentication
[openid_response_nonce] => 2009-09-26T10:54:41ZLg0kfQ
[openid_return_to] => http://www.wasab.dk/morten/2007/11/openid/?janrain_nonce=2009-09-26T10%3A54%3A37Z9rZCkP&openid1_claimed_id=http%3A%2F%2Fwww.roket-enterprises.com%2Fopenaccount%2Fopenid%3Ajrhodes
[openid_sig] => Xl94j3IJtfSEQ4oKfova68I8edc=
[openid_signed] => assoc_handle,identity,mode,response_nonce,return_to,signed,sreg.email,sreg.fullname,sreg.nickname
[openid_sreg_email] => jrhodes#roket-enterprises.com
[openid_sreg_fullname] => James Rhodes
[openid_sreg_nickname] => jrhodes
)
Using Specific Mode Endpoint Handler...
Answering check_authentication
Headers:
Content-Type: text/plain;
openid.mode: id_res;
openid_mode: id_res;
sreg.fullname: James Rhodes;
sreg.nickname: jrhodes;
sreg.email: jrhodes#roket-enterprises.com;
is_valid: true;
The GET and POST data is the data that my script is receiving. Everything after "Headers:" are the headers that my script is returning. According to the specifications, I can't see anything wrong with this.
I've been asking on #openid for the last 4 hours and haven't got a response (note to self: post on StackOverflow, then ask IRC). Can anyone help?

Related

Laravel one way communication

I want laravel backend to send a message to my Ionic App whenever there is an entry in my database. I don't want to do polling at frontend, found this library rukavina/kurento-client-php
(https://github.com/rukavina/kurento-client-php) but unable to get any success as I was getting this error.
Array (
[code] => 40201
[data] => Array (
[type] => SDP_PARSE_ERROR
)
[message] => Empty offer not valid
)
Can anyone help me who either implemented kurento-client-php library or worked on similar situation.
Finally did it using Laravel-ratchet and php-zmq.

Shopify is giving error 400 [Bad Request] when using https://{shop}.myshopify.com/admin/oauth/access_token

I was developing a Shopify App. It was working fine till yesterday evening, but then I started getting the Bad Request [400] error, after the user allow access to the app for his shop.
Error is below
(https://SHOP-NAME.myshopify.com/admin/oauth/access_token) in /path/to/shopify/authentication/oauth.php on line 28
Array (
[method] => POST
[uri] => https://SHOP-NAME.myshopify.com/admin/oauth/access_token
[query] => Array ( )
[headers] => Array ( )
[payload] => Array (
[client_id] => {CLIENTID}
[client_secret] => {CLIENT_SECRET}
[code] => {CODE}
)
)
I'm doing a POST cURL Request with Content-Type:application/x-www-form-urlencode and all the request are validated to be coming from shopify.
If anyone want more information I can provide.
Thanks.
If this happening after the user authorizes the app, it could be an issue with the permanent token they have received. You could try grabbing the token that is generated and doing a POSTMAN request manually to query the API to verify the token works.
If it worked before and you didn't make any changes to the app, it could be a temporary API issue, even though I found that to be rare with my app.
The code parameter that is sent from Shopify can only be used a single time.
If you re-make the original request that sends the code parameter to your server, you should be able to make the call successfully.

how to know where http request 302 leads?

I'm working on Shopify API and trying to register uninstall webhook for my plugin which is registered successfully and i do get a response e.g.
stdClass Object
(
[webhook] => stdClass Object
(
[id] => 52102211
[address] => http://www.example.com/dev1/login?code=42db53dae6d706f095711b8365a941e8&hmac=6ca8a5fa6659ea9b976454d352c73024d98417b0e20665c08090c636d3c9662b&shop=my-shopify-shop.myshopify.comsignature=ed384b260216b100ea2090e0d3c26460×tamp=1438850605/delete_shop
[topic] => app/uninstalled
[created_at] => 2015-08-06T04:43:27-04:00
[updated_at] => 2015-08-06T04:43:27-04:00
[format] => json
[fields] => Array
(
)
[metafield_namespaces] => Array
(
)
)
)
When i delete my plugin it generates a 302 POST request.
I want to see that where does this request leads so that I'd be sure that it is coming straight to my controller action for handling this i.e. to example.com/delete_shop
I'm working in PHP CI and sending email in my code upon the call of this function. Here are the routes:
$route['default_controller'] = "home";
$route['product_edit/:any'] = "home/product_edit";
$route['delete_shop'] = "home/delete_shop";
$route['404_override'] = '';
Is there any problem with my routes because I never receive an email even after hours?
(email functionality is working properly in the application though)
EDIT :
here is the image for the request generated
A 302 is a temporaly redirect. You can follow the requests with tools as:
Firebug (https://getfirebug.com/downloads)
Browser console for developers in Chrome, Safari, Firefox, Internet Explorer, etc.
The tools above make it possible to log the requests. Detailed information provided, such as request headers, response headers, response body, etc.

Fetch Report using GoodData API

I have created a report on my GoodData UI. Now I want to fetch this report using the API. I spent hours digging the API docs but I am unable to find a simple way to do so.
If I try gdc/execute/raw/, it returns
[error] => Array
(
[parameters] => Array
(
[0] => execute
)
[requestId] => 53fPgKcFdkjf8PZ5:4n6x9lp9vk3ydbvs
[component] => GDC
[errorClass] => GDC::Exception::NotFound
[message] => resource %s not found
)
If I try gdc/xtab2/executor3 it returns
[error] => Array
(
[parameters] => Array
(
[0] => report_req
[1] => STRUCTURE INVALID - name of structure:'ReportReq'(tag:report_req), /report_req/ExecutionObject: Object does not match any alternative. Alternatives tried : [STRUCTURE INVALID - name of structure:'ReportReq' ...]
)
[requestId] => a0yRpNUpCPRsbPS0:6nagmwaw61h5g2bn
[component] => Apache::REST
[errorClass] => GDC::Exception::User
[message] => Checking '%s', result %s
)
Your requests got 404 and 400 statuses respectively.
When you tried to use 'gdc/execute/raw/' the call that reached our side was: "request="POST /gdc/execute/raw/ HTTP/1.1"", instead of that it should look like "POST /gdc/app/projects/{your_project_id}/execute/raw/ HTTP/1.1", that's the reason your are getting a 'NotFound' error. Regarding 'gdc/xtab2/executor3' there's apparently something wrong within the body of the call.
Please post your calls here, their bodies and how exactly you are making them, or open a support ticket with those details at https://support.gooddata.com/home so that we can investigate further.
Ultimately I followed this code piece https://gist.github.com/gnilrets/b9d2ce9890d8aaa07042
Much better than reading the whole GoodData API documentation.

Google Calendar Push Notification watch command in php

I am using the php watch commant:
$service = new Google_Service_Calendar($client);
$channel = new Google_Service_Calendar_Channel($client);
$channel->setId('20fdedbf0-a845-11e3-1515e2-0800200c9a6689111');
$channel->setType('web_hook');
$channel->setAddress('https://www.exampel.com/app/notification');
$watchEvent = $service->events->watch('primary', $channel);
This command works fine and I get the response:
Google_Service_Calendar_Channel Object ( [address] => [expiration] => 1401960485000 [id] => 20fdedbf0-a845-11e3-1515e2-0800200c9a6689111 [kind] => api#channel [params] => [payload] => [resourceId] => HZjSdbhwcd5KMKEA3ATA31LoR-w [resourceUri] => https://www.googleapis.com/calendar/v3/calendars/primary/events?key=AIzaSyBl_Y7Y4eQDve-0DjwzBEP7_qOLo-67ouY&alt=json [token] => [type] => [modelData:protected] => Array ( ) [processed:protected] => Array ( ) )
However; In my set up url I don't get any message when something changes in my calendar.
Am I missing something!?
I had a similar issue which was caused by authentication on my application.
Try sending a post request to https://www.exampel.com/app/notification and see if it is received. If not, double check your routing or authentication.
Also ensure that the endpoint is a valid https URL. Self-signed certificates are not allowed.
Source: https://developers.google.com/google-apps/calendar/v3/push
I have faced this issue today, so want to add some more details here.
Google only send the headers to your URL. so if you are waiting for getting some data (just like me) you won't get any (except some cases).
Check this Google Calendar API docs for Receiving Notifications
Understanding the notification message format
All notification messages include a set of HTTP headers that have X-Goog- prefixes. Some types of notifications can also include a message body.
Here are the headers I received in my webhook callback URL.
[Host] => mydomain.com
[X-Goog-Channel-ID] => 10ddfddt0-a995-10f4-1254e2-0000000a0a0609001
[X-Goog-Channel-Expiration] => Thu, 11 Jan 2018 10:04:04 GMT
[X-Goog-Resource-State] => exists
[X-Goog-Message-Number] => 2526579
[X-Goog-Resource-ID] => 9OG_a-ECJycPkpNR1ZrWSon5_i1
[X-Goog-Resource-URI] => https://www.googleapis.com/calendar/v3/calendars/primary/events?maxResults=250&alt=json
[Content-Length] => 0
[Connection] => keep-alive
[User-Agent] => APIs-Google; (+https://developers.google.com/webmasters/APIs-Google.html)
[Accept-Encoding] => gzip,deflate,br
I also found some additional code sample here which you can use if you want to make the request to Google API without client library.
Hope this help someone.

Categories