An uncaught Exception was encountered Type: Google_Auth_Exception Message: Error fetching OAuth2 access token, message: 'invalid_grant: Bad Request' - oauth2-playground

An uncaught Exception was encountered
Type: Google_Auth_Exception
Message: Error fetching OAuth2 access token, message: 'invalid_grant: Bad Request'

Related

AWS API Gateway fails to fetch Apple /.well-known/openid-configuration

I have a SAM template that defines the following API:
MyApi:
Type: AWS::Serverless::HttpApi
Properties:
FailOnWarnings: true # <--- it succeeds without this
Auth:
Authorizers:
AppleSignIn:
JwtConfiguration:
audience:
- com.domain.MyApp
issuer: "https://appleid.apple.com"
IdentitySource: "$request.header.Authorization"
When I run this with FailOnWarnings:true, I get this warning (which is treated as an error):
Resource handler returned message:
Warnings found during import: Unable to create Authorizer
'AppleSignIn': Caught exception when connecting to
https://appleid.apple.com/.well-known/openid-configuration for issuer
https://appleid.apple.com. Please try again later. Error: Invalid
issuer: https://appleid.apple.com. Issuer must have a valid discovery
endpoint ended with '/.well-known/openid-configuration'. Ignoring.
(Service: AmazonApiGatewayV2; Status Code: 400; Error Code:
BadRequestException; Request ID: 409removed8b6;
Proxy: null) (Service: null; Status Code: 404; Error Code:
BadRequestException; Request ID: null; Proxy: null) (RequestToken: 43fremoved3b9, HandlerErrorCode:
GeneralServiceException)
However, as far as I can tell, https://appleid.apple.com/.well-known/openid-configuration is available and valid -- not sure why it would fail with 400 or 404. If I remove FailOnWarnings, it can deploy and the authorizer works, but I prefer to keep it strict.

send notification from Prometheus alertmanager to Google Chat room

we recently started using Google Chat in our organisation therefor we need to send alerts from Prometheus-Alertmanager to Google Chat room. below is my alertmanager config for Google chat
receiver:
- name: 'gchat-receiver'
webhook_configs:
- url: "https://chat.googleapis.com/v1/spaces/AAAArcv5Snw/messages?key=KEY&token=TOKEN"
send_resolved: false
and when we implementing above config we are getting below error in our alertmanager logs:
level=error ts=2021-02-23T06:23:43.931Z caller=dispatch.go:309 component=dispatcher msg="Notify for alerts failed" num_alerts=2 err="gchat-receiver/webhook[0]: notify retry canceled due to unrecoverable error after 1 attempts: unexpected status code 400: https://chat.googleapis.com/v1/spaces/AAAArcv5Snw/messages?key=KEY&token=TOKEN"
level=error ts=2021-02-23T06:23:43.971Z caller=dispatch.go:309 component=dispatcher msg="Notify for alerts failed" num_alerts=1 err="gchat-receiver/webhook[0]: notify retry canceled due to unrecoverable error after 1 attempts: unexpected status code 400: https://chat.googleapis.com/v1/spaces/AAAArcv5Snw/messages?key=KEY&token=TOKEN"
level=error ts=2021-02-23T06:23:43.976Z caller=dispatch.go:309 component=dispatcher msg="Notify for alerts failed" num_alerts=21 err="gchat-receiver/webhook[0]: notify retry canceled due to unrecoverable error after 1 attempts: unexpected status code 400: https://chat.googleapis.com/v1/spaces/AAAArcv5Snw/messages?key=KEY&token=TOKEN"
level=error ts=2021-02-23T06:23:43.994Z caller=dispatch.go:309 component=dispatcher msg="Notify for alerts failed" num_alerts=2 err="gchat-receiver/webhook[0]: notify retry canceled due to unrecoverable error after 1 attempts: unexpected status code 400: https://chat.googleapis.com/v1/spaces/AAAArcv5Snw/messages?key=KEY&token=TOKEN"
any help or guidance on this would be highly appreciated
That is because Google Chat expects a specific JSON payload schema to be posted to that webhook address and the default Alertmanager payload doesn't match it, so you get HTTP 400 response: bad request.
You might need to put a custom application in between to transform the JSON to Google Chat acceptable format. There are already some repos in Github that match that general criteria as well. (e.g calert)

401 on azure-devops-node-api with access token acquired from adal-node

This is an issue between adal-node and azure-devops-node-api.
After getting access token from adal-node, I apply it as API_TOKEN to call azure-devops-node-api's getWebApi, target api is azure devops(vsts)-https://dev.azure.com/{org}.
Unfortunatelly, it returns 401 error:
Error: Error: Failed request: (401)
at RestClient.
at Generator.next ()

TYPO3 - Deactivating cHash in own extension causes error when accessing record

If I add noCacheHash="1" to link.action I can deactivate cHash:
<f:link.action action="show" pageUid="43" arguments="{record:record.uid}" noCacheHash="1">{record.name}</f:link.action>
/?tx_abc_abc[record]=1&tx_abc_abc[action]=show&tx_abc_abc[controller]=Abc
But when trying to access a record I get the following error:
Uncaught TYPO3 Exception
#1509296606: Failed to fetch error page "domain/index.php?id=72", reason: Client error: `GET domain/index.php?id=72` resulted in a `401 Unauthorized` response: <script>window.location.href='domain/access-denied/';</script><noscript>Error 401 - Access Deni (truncated...)
20 TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::pageErrorHandler("domain/index.php?id=72", "HTTP/1.0 404 Not Found", "Request parameters could not be validated (&cHash empty)")
How can I access the record properly when deactivating cHash?
This is not cause with noCacheHash parameters. I think you set special permission for pageID(43). So, this page is not access for this record.
So, First check this page access permission.

error on get /me with access_token facebook php sdk 3.1.1

If i try:
https://graph.facebook.com/me?access_token=MY_ACCESS_TOKEN
It works. But if I make a call:
$user_profile = $facebook->api('/me?access_token='.MY_ACCESS_TOKEN);
It doesn't work:
Fatal error: Uncaught OAuthException: An active access token must be used to query information about the current user. thrown in /home/jill/web/public/condividi/libs/facebook/base_facebook.php on line 1033