I am using this link: https://cloud.google.com/composer/docs/composer-2/triggering-with-gcf in order to trigger a DAG using airflow2.
However I am getting this error:
requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://myairflow/api/v1/dags/lmbr-agentgroup-gcs-to-raw/dagRuns
However there aren't any place to put some kind of authentication in the code provide in the link of google material.
Does anyone faced this problem and know how to fixed?
I was using the default user in cloud function which is: appengine. after that I found more information and use this command to list all user who has permission
gcloud composer environments run myAirflowEnv --location=southamerica-east1 users -- list
and I used one of this user on cloud function, but it didn't work as well.
same error: requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://myAirflow/api/v1/dags/mydag/dagRuns
Related
Trying to figure out how to use Google's play-integrity api to verify nonces.
I've hit this roadblock and am unsure what other things I could try to debug and get more information out of this API. Below is a series of steps I've taken to get to the point I'm currently at.
What I've done:
Created a service account within the Google Cloud project with the grants:
Service Account User and Service Usage Consumer
Setup Google Auth Default Credentials
Set environment variable:GOOGLE_APPLICATION_CREDENTIALS by pulling down imported json from service account.
Where I'm at now:
Used google-api-client to build and call playintegrity, resulting in the response:
Code snippet:
response = service.v1().decodeIntegrityToken(
packageName='com.myapp.package',
body={
'integrityToken':'superLongString'
}
).execute()
raise HttpError(resp, content, uri=self.uri)
googleapiclient.errors.HttpError: <HttpError 400 when requesting
https://playintegrity.googleapis.com/v1/com.myapp.package:decodeIntegrityToken?alt=json
returned "Integrity token cannot be decoded due to invalid arguments.".
Details: "Integrity token cannot be decoded due to invalid arguments.">
What I'm trying to do:
I'm trying to better understand how to call decodeIntegrityToken with the right parameters or configurations to retrieve a 200. It is not immediately clear to me which of it is is and what the next steps to debug are.
Resources used:
https://developer.android.com/google/play/integrity/verdict#returned-payload-format
Decode integrity token using Google PlayIntegrity API
If you are receiving an INTEGRITY_INVALID_ARGUMENT check one of the following:
arguments in body_request are incorrect.
integrity_token, which is retrieved by google upon sending over a nonce. Note that this integrity_token needs to be correct or else it will still send the same error message above.
I am trying to fetch the list of resources present in my Azure Resource Group.
To do that, I got an access token by registering one app in Azure AD using the client_credentials flow.
But when I am using that token to query like below, I'm getting 401 Unauthorized - Authentication failed error.
Query that I used:
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/resources?api-version=2021-04-01
I have owner access to all my resources but why am I getting 401 Unauthorized error. Is there any step that I missed?
Can anyone point me in a right path?
I came to know I have to give API permissions for Azure Service Management.
After giving user_impersonation, I changed the scope to https://management.azure.com/.default and got access token.
Using this token, I successfully got the list of resources without any errors.
There have been loads of topics on this error and I've spent hours reading through them. I am getting this error when trying to load the URL of my Post method (it works fine when I test it within the AWS console). When I run the URL created after I deployed it:
https://somehexvalues.execute-api.us-east-1.amazonaws.com/prod/temperature
I get this errror: message "Missing Authentication Token"
I can see the response contained this error: missingAuthenticationTokenException
I've done the exact same thing with a Get and had no problems. Is this something specific to Post?
I deployed the app after every change and took the URL from the method's STAGES tab.
Validation and authentication are set to "None"
Is there anything else I can do to debug this?
I'm trying to login Cloud Foundry endpoint.
But when I connect by Cloud Foundry CLI, I get a error message below:
C:\Users\abc>cf login -a https://xxx.predix-
uaa.run.aws-usw02-pr.ice.predix.io
API endpoint: https://xxx.predix-uaa.run.aws-us
w02-pr.ice.predix.io
Not logged in. Use 'cf login' to log in.
FAILED
Error performing request: Get /login: unsupported protocol scheme ""
Please help!
The issue is likely that you are not specifying your CF API endpoint url. Please contact your platform operator to confirm what it should be.
We'll improve the error message, but what seems to be happening is that the cf CLI tries to retrieve a json configuration from [api-endpoint]/v2/info, but not getting the response it expects.
It then builds a URL to the login endpoint from the "authorization_endpoint" that should be advertised in that json configuration. As that field is not in your response, it tries to access "/login" instead of e.g. "https://xxx.predix-uaa.run.aws-usw02-pr.ice.predix.io/login", causing the error.
CF endpoint urls generally start with "api.". In fact, I've never seen one starting differently.
I'm using the excellent Django Social Auth app to handle logins from a variety of services. This works nicely with Twitter, Facebook and LinkedIn but I can't figure out why it will not work with Google. I have got this message numerous times trying all the options that I can think:
Error: redirect_uri_mismatch
Request Details
scope=https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email
response_type=code
access_type=offline
redirect_uri=http://dev.mysite.com/complete/google-oauth2/
next=/close_login_popup/
state=OHZtGyZPyrM0XUjzEsf8dv22VAZGXSY6
display=page
client_id=820357455247-4levikqugduodacfc8j3b5dhsvmbbnnb.apps.googleusercontent.com
To create the API key, I went to https://code.google.com/apis/ then filled out the form using the following steps:
Then, I chose 'Installed Application' which I don't fully understand but most documentation suggest this option. I have tried both other options without success:
If I try creating a Web Application specifying http://.dev.mysite.com I get the following error:
Error: redirect_uri_mismatch
The redirect URI in the request: http://dev.mysite.com/complete/google-oauth2/ did not match a registered redirect URI
Learn more
Request Details
scope=https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email
response_type=code
access_type=online
redirect_uri=http://dev.mysite.com/complete/google-oauth2/
next=/close_login_popup/
state=xcpu93i7XJJmYlwXnRbkfgEwsbbR1O7c
display=page
client_id=606300275392.apps.googleusercontent.com
My objective is to have a link that someone can click on, give permissions to Google and then log in to my site. I'm testing this on the actual site, wwww.dev.mysite.com and when trying the other options for key generation I specified dev.mysite.com. I would appreciate any suggestions of what to try next as I've run out of ideas.