I am working on an sms feature by the Nexmo package.
However I encountered an error which is:
Please provide Nexmo API credentials. Possible combinations: api_key + api_secret, api_key + signature_secret, private_key + application_id, api_key + api_secret + private_key + application_id, api_key + signature_secret + private_key + application_id
Though I already filled up my .env and config/nexmo.php files.
I've just created a new Laravel project using the guide from the repo and got this new error message.
>cURL error 60: SSL certificate problem: unable to get local issuer certificate (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)
The repo is working fine and just my xampp is the issue.
My solution was as simple as: Follow this link: http://curl.haxx.se/ca/cacert.pem Copy the entire page and save it in a: "cacert.pem"
Then in your php.ini file insert or edit the following line: curl.cainfo = "[pathtothisfile]\cacert.pem"
Related
i am trying to access google search console api - tried the sample [https://github.com/googleapis/google-api-python-client/blob/master/samples/searchconsole/search_analytics_api_sample.py][1]
i followed the instructions:
1) Install the Google Python client library, as shown at
https://developers.google.com/webmaster-tools/v3/libraries.
2) Sign up for a new project in the Google APIs console at
https://code.google.com/apis/console.
3) Register the project to use
OAuth2.0 for installed applications.
4) Copy your client ID, client
secret, and redirect URL into the client_secrets.json file included in
this package.
5) Run the app in the command-line as shown below.
Sample usage: $ python search_analytics_api_sample.py
'https://www.example.com/' '2015-05-01' '2015-05-30'
of course for my site and newer dates..
recieved in cmd the warning:
\AppData\Local\Programs\Python\Python38\lib\site-packages\oauth2client_helpers.py:255:
UserWarning: Cannot access webmasters.dat: No such file or directory
in the window opened in the browser got the message:
Error 400: redirect_uri_mismatch The redirect URI in the request,
http://localhost:8080/, does not match the ones authorized for the
OAuth client. To update the authorized redirect URIs, visit:
https://console.developers.google.com/apis/credentials/oauthclient/xxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com?project=xxxxxxxxxxxx
i configured the redirect URI as http://localhost:8080/ but still the same
appreciate any help thanks
I'm working on a project to automate google cloud setup, is there any way to create a google cloud platform project using Google-Api-Client for python?
Help me, please!
Thanks in advance!
Here's what I have tried:
From views.py
from google.cloud import resource_manager
...
client = resource_manager.Client()
# List down all gcp projects
for project in client.list_projects():
print(project)
new_project = client.new_project('project11-372', name='My new project')
new_project.create()
It list down all of my gcp projects but doesn't create new project.
Here's the error I have received:
File "/Users/abdul/Documents/IGui/rest/views.py", line 60, in post
new_project.create()
File "/Users/abdul/IstioVirEnv/lib/python3.6/site-packages/google/cloud/resource_manager/project.py", line 138, in create
data=data)
File "/Users/abdul/IstioVirEnv/lib/python3.6/site-packages/google/cloud/_http.py", line 293, in api_request
raise exceptions.from_http_response(response)
google.cloud.exceptions.Forbidden: 403 POST https://cloudresourcemanager.googleapis.com/v1beta1/projects: The caller does not have permission.
[20/Aug/2017 05:55:02] "POST /user/deployment/create/new HTTP/1.1" 500 14960
I have successfully created google cloud project by using Google cloud API python client.
Steps
run gcloud beta auth application-default login command to get application default credentials by login onto the browser
Enable Resource Manager API on my gcp console
Here's the working python code:
from googleapiclient import discovery
from oauth2client.client import GoogleCredentials
...
credentials = GoogleCredentials.get_application_default()
service = discovery.build('cloudresourcemanager', 'v1', credentials=credentials)
project_body = {
'name': 'Api Project',
'projectId': 'api-9837'
}
request = service.projects().create(body=project_body)
request.execute()
pprint(request)
I have a new computer and I'm trying to set up my AWS CLI environment so that I can run a management console I've created.
This is the code I'm running:
def create_bucket(bucket_args)
AWS_S3 = Aws::S3::Client.new(signature_version: 'v4')
AWS_S3.create_bucket(bucket_args)
end
Which raises this error:
Aws::S3::Errors::SignatureDoesNotMatch - The request signature we calculated does not match the signature you provided. Check your key and signing method.:
This was working properly on my other computer, which I no longer have access to. I remember debugging this same error on the other computer, and I thought I had resolved it by adding signature_version = s3v4 to my ~/.aws/config file. But this fix is not working on my new computer, and I'm not sure why.
To give some more context: I am using aws-sdk (2.5.5) and these aws cli specs: aws-cli/1.11.2 Python/2.7.12 Linux/4.4.0-38-generic botocore/1.4.60
In this case the issue was that my aws credentials (in ~/.aws/credentials) - specifically my secret token - were invalid.
The original had a slash in it:
xx/xxxxxxxxxxxxxxxxxxxxxxxxxx
which I didn't notice at first, so when I double clicked the token to select the word, it didn't include the first three characters. I then pasted this into the terminal when running aws configure.
To fix this, I found the correct, original secret acceess token and set the correct value in ~/.aws/credentials.
Ive been trying to get Mailgun with templates working on my parse server currently running on Heroku.
At the moment I am running fine with parse-server-simple-mailgun-adapter
which comes preinstalled in parse server.
However i am unsure on how to install parse-server-mailgun-adapter-template
or parse-server-mailgun which allow you to use HTML templates for emails...
On Heroku my files are sync'd from Dropbox and deployed. Could someone please give me a step by step guide on how to install and go about this.
Thanks in advance
leveraging custom email adapter is done when you initialise ParseServer .
so in order to use parse-server-mailgun-adapter-template (for example) you need to do the following steps:
Open index.js file of your parse server project
Go to the line where ParseServer is being initialised. It should look like the following:
var api = new ParseServer({
databaseURI: databaseUri || 'mongodb://localhost:27017/db',
cloud: process.env.CLOUD_CODE_MAIN || __dirname + '/cloud/main.js',
...
In terminal go to the folder where your parse server is installed and run the following command:
npm install parse-server-mailgun-adapter-template --save
this will install the parse-server-mailgun-adapter-template module to your parse server app (by adding it to package.json and execute npm install)
Add a new object inside the constructor with the name of emailAdapter, specify the adapter that you want to use under module and then add all the relevant properties that this custom adapter expect to receive so for parse-server-mailgun-adapter-template it will be
emailAdapter: {
module: 'parse-server-mailgun-adapter-template',
options: {
// The address that your emails come from
fromAddress: 'no-reply#yourdomain.com',
// Your domain from mailgun.com
domain: 'mg.yourdomain.com',
// Your API key from mailgun.com
apiKey: 'key-0123456789abcdefghijklmnopqrstuv',
// Verification email subject
verificationSubject: 'Please verify your e-mail for %appname%',
// Verification email body
verificationBody: 'Hi,\n\nYou are being asked to confirm the e-mail address %email% with %appname%\n\nClick here to confirm it:\n%link%',
//OPTIONAL (will send HTML version of email):
verificationBodyHTML: fs.readFileSync("./verificationBody.html", "utf8") || null,
// Password reset email subject
passwordResetSubject: 'Password Reset Request for %appname%',
// Password reset email body
passwordResetBody: 'Hi,\n\nYou requested a password reset for %appname%.\n\nClick here to reset it:\n%link%',
//OPTIONAL (will send HTML version of email):
passwordResetBodyHTML: "<!DOCTYPE html><html xmlns=http://www.w3.org/1999/xhtml>........"
}
}
That's it. Now you can add your custom templates for email verification and password reset and sending emails .
I'm using this plugin to enable SSO between my IDP and redmine. Purpose is to avoid re entering username and password when login to the redmine. Both Redmine and the IDP connected to an external LDAP. Problem is after redirecting back to the redmine from my IDP (after entering username & password), It's giving this error.
Redmine version: 2.5.2,
Ruby version: 1.9.3,
Rails version: 3.2.19
Some details for Redmine 3.4.2
If you get an error 422 (Can't verify CSRF token authenticity),
you must go to controller file
/app/controller/aplication_controller.rb
and remove or comment string with code
render_error :status => 422, :message => "invalid form authenticity token."
then add code
redirect_back_or_default(home_path)
So, your code will be like this
# render_error :status => 422, :message => "invalid form authenticity token."
redirect_back_or_default(home_path)
For us, this error appeared when an already logged-on user tried to re-logon (eg. using multiple browser tabs).
The solution is here, patch application_controller.rb:
- render_error "Invalid form authenticity token."
+ redirect_back_or_default home_path
It happened to us when using a reverse-proxy SSO. The configured name in the SSO was not with the same case than the user name within Redmine.
Extract from nginx configuration :
# Pass the user to that stupid Passenger Phusion
# that cannot evaluate variables like $http_x_forwarded_user
passenger_env_var REMOTE_USER nicolasm;
And our user name in Redmine was NicolasM.
Removing security as suggested by other answers is not a long lasting solution.