WP 8.1 Push notifications - Invalid Client Secret [duplicate] - windows

This question already has answers here:
Where i can obtain client secret for my Universal app?
(2 answers)
Closed 6 years ago.
I'm following this guide (msdn.microsoft.com/library/windows/apps/hh465407) to implement push notifications on my app, but it seems to be outdated since I can't find the client secret as shown in this image (https://msdn.microsoft.com/dynimg/IC737349.png).
If I try to register using the password i can generate at (https://apps.dev.microsoft.com), I get an error message.
Request:
POST /accesstoken.srf HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Host: https://login.live.com
grant_type=client_credentials&client_id=ms-app%3a%2f%2fS-1-15-2-3747961549-[...]&client_secret=[???]&scope=notify.windows.com
Response:
{
"error": "invalid_client",
"error_description": "Invalid client secret"
}
So, where to find this client secret?

You must login into the microsoft dev dashboard, create a new app (you don't have to load a .xap file, you just need to put in a name and all those stuffs...)
After that, click on the app you just created: on the left, select "services" from the menu and then click on the "push notification" link.
Finally, on the page you will see now, click the "live services website" link that you will see on the second text paragraph. you should now see a page with your secret code.
let me know if you resolved the problem, cheers!

Related

spring social google: people API 403 Forbidden due to Legacy People API

I've got project, where I have to login through google sign in. I have created google project. Set up client/secret keys. I got to the point where I'm making post request to my web app server and sending there the accessToken:
OAuth2ConnectionFactory<Google> connectionFactory = (OAuth2ConnectionFactory<Google>) connectionFactoryLocator().getConnectionFactory(Google.class);
AccessGrant accessGrant = new AccessGrant(accessToken);
Connection<Google> connection = connectionFactory.createConnection(accessGrant);
The request is:
GET https://www.googleapis.com/plus/v1/people/me
Accept: application/json, application/*+json
Authorization: Bearer etc.
Here I got exception: 403 Forbidden. I had to manually track what the actual request is done and made rest request manually to replicate the issue with given headers.
Here is the result I'm getting:
"code": 403, "message": "Legacy People API has not been used in
project ... before or it is disabled. Enable it by visiting
https://console.developers.google.com/apis/api/legacypeople.googleapis.com/overview?project=...
then retry. If you enabled this API recently, wait a few minutes for
the action to propagate to our systems and retry."
First of all the link fails to load. I didn't find any "Legacy People API". Only new People API.
I wonder if there is any solution to this problem? I have enabled People API and waited for long enough but the same error remains.
EDIT 1:
I think the project spring-social is dead. Will rewrite login logic and kick spring-social out of it..
ME TOO . this my problem. I'm waiting 6 hours
"code": 403, "message": "Legacy People API has not been used in project
Try using the Google Identity Platform OAuth API instead of the Legacy People API.

Setup a basic WebSocket mock in AWS ApiGateway

I am trying to setup an extremely simple WebSocket mock within AWS ApiGateway. However, every attempt I've tried gives me an error:
13:36:52 (X33uOGUfIAMFq7w=) Extended Request Id: X33uOGUfIAMFq7w=
13:36:52 (X33uOGUfIAMFq7w=) Verifying Usage Plan for request: X33uOGUfIAMFq7w=. API Key: API Stage: redacted/prod
13:36:52 (X33uOGUfIAMFq7w=) API Key authorized because route '$connect' does not require API Key. Request will not contribute to throttle or quota limits
13:36:52 (X33uOGUfIAMFq7w=) Usage Plan check succeeded for API Key and API Stage redacted/prod
13:36:52 (X33uOGUfIAMFq7w=) Starting execution for request: X33uOGUfIAMFq7w=
13:36:52 (X33uOGUfIAMFq7w=) WebSocket Request Route: [$connect]
13:36:52 (X33uOGUfIAMFq7w=) Client [UserAgent: null, SourceIp: redacted] attempts to connect to WebSocket API [redacted].
13:36:52 (X33uOGUfIAMFq7w=) Execution failed due to configuration error: statusCode should be an integer which defined in request template
13:36:52 (X33uOGUfIAMFq7w=) Client [UserAgent: null, SourceIp: redacted] failed to connect to API [redacted].
As far as I can tell, I've followed the most basic configuration possible. I do not need any responses or templates, just simple a WebSocket connection that allows me to connect to it and do nothing, or perhaps respond to ping requests with a pong eventaully.
All authorizations and API keys are disabled. No request templates or integration responses are setup since I do not need them. Again, the goal is to just be able to have a dumb WebSocket that can be connected to.
However, whenever I try to connect to it, I get a 500 error with the error logs from above about a status code.
WebSocket connection to 'wss://redacted.execute-api.us-east-1.amazonaws.com/prod' failed: Error during WebSocket handshake: Unexpected response code: 500
Using the following sources (below), I was able to get a quick and loose example AWS API Gateway connection working use MOCK endpoints with web sockets. I'm sure this can be flushed out more to provide an even better understanding of different request/response body messages and codes..
First, go to API Gateway, click Create API
For Choose the protocol, select WebSocket
Give the API a name, and use the example $request.body.message for the route selection expression
Click the Create API button
Select the new API from the side pane, and click Routes
Select the $connect route
Under Route overview, select the Mock radio button for endpoint
For the Request Template, enter an expression (using 200 for example).
For Template Key, enter a key (using 200 for example)
For the popup window on passthrough behavior, select No, Use Current Settings for now
Click on the Template Key 200, and enter a template: {"statusCode" : 200} and then click the Save button.
Select Route Overview to go back to the $connect overview page and then select the Add Integration Response button
Create a response key of $default, which will reference the $default key under Routes
For the $disconnect route, please repeat steps 7 - 13 for this specific route.
Once done setting up the $disconnect route, please select the $default route under the Routes pane.
Create an Integration Request the same way that was done for $connect and $disconnect (steps 7 - 11)
For Integration Response under $default, we will be setting the route response up slightly different than $connect and $disconnect as those 2 routes' responses actually reference the $default response within their own respective Integration Responses.
Create a response key of $default
Enter a Template Selection Expression (using 200 for this example)
Then create a Template Key (using 200 for this example)
Click on the Template Key 200, and enter a template: {"statusCode" : 200, "connectionId" : "$context.connectionId"} and then click the Save button.
{"connectionId" : "$context.connectionId"} was added to the response payload to show how variables can be used within the response to represent an actual value of the connection.
Finally, under the Actions dropdown, select Deploy API, and enter a deployment stage name. This should generate a WebSocket URL that can now be connected to e.g. (wss://#######.execute-api.us-east-1.amazonaws.com/Test)
Using wscat via cli, I am now able to connect to my WebSocket URL (see source below for installing wscat): wscat -c wss://#######.execute-api.us-east-1.amazonaws.com/Test
Sources:
https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-how-to-call-websocket-api-wscat.html
https://forums.aws.amazon.com/thread.jspa?threadID=299642&tstart=0
I've automated the steps described by Woodrow using CloudFormation so now anyone can reproduce it more easily.
The template can be found here: https://gist.github.com/maatthc/9d2dfe0448733f0ee1624d658fbac80f .
To create a new stack using it you should:
Download the template to your machine.
Head to Cloudformation in the AWS Console (https://ap-southeast-2.console.aws.amazon.com/cloudformation/) - Change your AWS Region.
Click in "Create Stack"
Choose "Upload a template file" and use the template you've downloaded.
Click Next, give the stack a name and click Next again.
Click Next and "Create Stack".
I hope it helps.
Cheers

Pinterest Authorization failed

We have problem with our prod pinterest application.
After getting token:
"{"access_token": "AabcYgRUKiaBI45HYM72teXO6fZaFQoEhVxkxaREoN3SR-
A4zAAAAAA", "token_type": "bearer", "scope": ["read_public",
"write_public", "read_private", "write_private", "read_relationships",
"read_write_all"]}"
Then we try get user info https://api.pinterest.com/v1/me
with this token Authorization: Bearer AabcYgRUKiaBI45HYM72teXO6fZaFQoEhVxkxaREoN3SR-A4zAAAAAA
and response
"{"status": "failure", "message": "Authorization failed.", "code": 3,
"data": null}"
Application status is In development now. Could it been changed by pinterest? Our dev app works as expected.
I got a response from Pinterest Help.
Feb 2, 09:32 PST
Thank you for providing all the information here. We're getting reports from multiple developers like yourself with the same issue. I'm going to be investigating further with our team and I'll let you know what we find!
No timeline right now on a fix, but I'll let you know when I get one.
"You're receiving that error response because your app has been denied policy approval."
Now only pinterest partners can use publish api.
Thanks for mentioning it in api doc and notification about changes.
I had the same error and wasted a few days trying to figure out why.
I have 2 accounts, user A and B. A is the dev and B is not a collaborator. I think that's why. The document says only collaborators can use the app without being approved by Pinterest.
The returned error message is useless. If it says so, I wouldn't have to create this ticket and the document is also lacking in my opinion.
Also, if non-collaborator can't be authenticated, the access_token step should fail first.
I know that my answer is weird but I was facing this error too. I just copy pasted the url from the Pinterest docs then added the access token then pasted it to the url search field. The mistake which I made is that there were extra spaces in the URL For example
https://api.pinterest.com/v1/me/pins/?
access_token=<YOUR-ACCESS-TOKEN>
&fields=id,creator,note
&limit=1
When you paste it to the url text field the "next line" (\n) would be replaced with spaces like %20. So you should rewrite your url in one line again in your editor or text file then paste it to the chrome url field.
Your final url should be like
https://api.pinterest.com/v1/me/pins/?access_token=<ACCESS-TOKEN>&fields=id,creator,note&limit=1

Send (Load) a URL to web browser and run it in background in APEX

Does Apex/Visualforce allow a URL which is stored as string in apex and run it in web browser in background.
Actually, that url is returned from a Docusign RestAPI callout for posting the envelope into "correction" status. The Envelope correction Status is not activated until i manually paste the url (link) in to a web browser and run it.
Does anyone know how to run a url programatically in a web browser through Apex/Visualforce in background ?
(or)
Is there anyway that i could activate the "correction" status of envelope in Docusign other than running the URL in web browser?
As I understand your question(s), the simple answer is NO/YES, but let me break it down:
Run String URL from Apex - Yes - See pagereference
https://www.salesforce.com/us/developer/docs/apexcode/Content/apex_system_pagereference.htm
Can you run a URL in Background - Yes you can use HTTP class
https://www.salesforce.com/us/developer/docs/apexcode/Content/apex_classes_restful_http_http.htm#apex_classes_restful_http_http
Can you run a DocuSign correct URL in Background - NO, the URL you get back requires the Browser for rendering and user UI interaction.
Other Way - YES via the DocuSign REST API you can correct the envelope if it has not been completed or the signer has not completed their signing action. Also I have lab I created to demonstrate this on Amazon if you are interested in a step by step example of DocuSign correct.
https://www.salesforce.com/us/developer/docs/apexcode/Content/apex_classes_restful_http_http.htm#apex_classes_restful_http_http
SAMPLE HTTP PUT via DS REST API below for existing an envelope:
PUT /restapi/v2/accounts/437977/envelopes/ed3be3c1-be06-41c2-c68c-10ddccbd655e/recipients
Host: demo.docusign.net
X-DocuSign-Authentication: {"Username":"yourdsemailorID","Password":"yourpasswordorDSapipassword","IntegratorKey":"yourDSintegratorkey"}
Content-Type: application/json
Accept: application/json
{ "signers": [ { "recipientId": "1", "name": "David W. Grigsby (corrected)", "email": "youremail#yourdomain.com" } ] }

Google Verification API 503

The google verification api is giving me a 503 error "An unexpected error occurred. Please try your request again." whenever I try to verify a domain using the TAG_MANAGER method.
This occurs when I try to use the API via the PHP client library and also when I use Google's API explorer. However, if I log in to Google Webmaster Tools and add the site, using Tag Manager as the verification method, I am able to successfully verify myself.
I've attached debugging information from the API explorer below, but it's very light on detail. My support request in the webmaster central forum has been met with deafening silence, but I'm not sure where else to ask.
Request
POST https://www.googleapis.com/siteVerification/v1/webResource?verificationMethod=TAG_MANAGER&key={YOUR_API_KEY}
Content-Type: application/json
Authorization: Bearer ya29.iAC-QBa-7nzvS2lpFFmfcej2Y0suhiWHgS8SivKN9jpYWffljsRV7rbL
X-JavaScript-User-Agent: Google APIs Explorer
{
"site": {
"identifier": "http://unit1-28leanyerdriveleanyer.com",
"type": "SITE"
},
"owners": [
"loboyle#raywhite.com"
]
}
Response
503 Service Unavailable
- Show headers -
{
"error": {
"errors": [
{
"domain": "global",
"reason": "backendError",
"message": "An unexpected error occurred. Please try your request again."
}
],
"code": 503,
"message": "An unexpected error occurred. Please try your request again."
}
}
https://www.googleapis.com/siteVerification/v1/webResource?verificationMethod=TAG_MANAGER&key={YOUR_API_KEY}
may need to be
https://www.googleapis.com/siteverification/v1/webResource?verificationMethod=TAG_MANAGER&key={YOUR_API_KEY}
also, a few additional notes
For Google to use your Google Tag Manager container snippet code for Webmaster Tools verification, the code must be placed immediately after the opening tag of your page.
The method you provided is used for verifying a site or domain, be sure you intend to verify a site, because this is what your request currently contains.
This method requires you to be authenticated (OAuth 2.0)
http://code.google.com/apis/accounts/docs/OAuth2.html
Ensure you have visited the following link
http://www.google.com/tagmanager/features.html
I finally stumbled across the fix for this today. The problem was that the service account running the requests needs to have "View and Manage" permissions on the applicable Tag Manager account, not just on the container that is actually being used. Only view access is required to the actual container.
While this isn't exactly desirable (we have 20+ containers for different sites/applications within the one account), it does resolve the problem and allow the Tag Manager site verification to work as intended.
I'm not sure whether the documentation has been changed since I originally had this problem or whether I just missed it. The required permissions are unexpected and the response code is misleading (a 403 would make more sense).
Check if you've enabled "Maintenance Mode" on your domain you're trying to verify using Google. Disable it and you're done.

Resources