Hi Fellow B4X'ers
A client has request for me to use AWS Cognito. I have no idea of what or how to do it. Can someone help please ???
They have given me the following pre-script I must run then a cURL...
Here is the pre-script (how do I run/convert it to B4A so that I can use it)
Thank you in anticipation...
(Anymore information required - please request - I'll post asap)
A client has request for me to use AWS Cognito. I have no idea of what or how to do it. Can someone help please ???
They have given me the following pre-script I must run then a cURL...
Here is the pre-script (how do I run/convert it to B4A so that I can use it)
js Pre- Script:
var clientId = pm.environment.get("cognitoClientId");
var clientSecret = pm.environment.get("cognitoClientSecret");
var username = pm.environment.get("cognitoUserName");
var password = pm.environment.get("cognitoUserPassword");
pm.sendRequest({
url: "https://cognito-idp.us-east-2.amazonaws.com/",
method: 'POST',
header: {
'X-Amz-Target': 'AWSCognitoIdentityProviderService.InitiateAuth',
'Content-Type': 'application/x-amz-json-1.1'
},
body: {
mode: 'raw',
raw: JSON.stringify({
"AuthParameters": {
"USERNAME": username,
"PASSWORD": password
},
"AuthFlow": "USER_PASSWORD_AUTH",
"ClientId": clientId
}),
options: {
raw: {
language: 'json'
}
}
}
}, function (error, response) {
console.log(response.json());
pm.environment.set("cognitoAccessToken", response.json().AuthenticationResult.AccessToken);
pm.environment.set("cognitoIdToken", response.json().AuthenticationResult.IdToken);
pm.environment.set("token", response.json().AuthenticationResult.AccessToken);
});
Thank you in anticipation...
(Anymore information required - please request - I'll post asap)