-
Notifications
You must be signed in to change notification settings - Fork 4
/
authorize.js
30 lines (30 loc) · 891 Bytes
/
authorize.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
var config = require('./config');
var ovh = require('ovh')({
endpoint: config.ENDPOINT,
appKey: config.APP_KEY,
appSecret: config.APP_SECRET
});
console.log("This utility will allow you to authorize this application on your OVH account...");
ovh.request('POST', '/auth/credential', {
'accessRules': [{
'method': 'GET',
'path': '/*'
}, {
'method': 'POST',
'path': '/*'
}]
}, function(error, credential) {
if (error) {
console.log("Got an error...");
console.error(error);
process.exit(1);
} else {
console.log("Success!");
console.log("Please do the following:");
console.log("1. Take the consumerKey and add it to config.js");
console.log("2. Visit the validationUrl and authorize this application");
console.log("3. Run node IP_RANGE=$YOURNETWORKRANGE generator.js");
console.log(credential);
process.exit(0);
}
});