Hello I have a problem trying to use auth0 on the dev domain, I quadruple check the callback URL and its fine the problem I notice on the logs that the Authorization Code for Access Token is not happening and i get the error https://dev.wololoci.com/admin?error=invalid_request&error_description=StatusCode%3A%20401&state=cGZwUWxKaklpTHN3U3Jjfi1QTmlJbHEtU2ZPLkZLSi5%2BR2VNWFhNaTdCSQ%3D%3D
Hi @jdelannoy
Sounds as if https://dev.wololoci.com/admin is the callback URL, right?
If so, the error that the app is receiving in the callback (āStatusCode 401ā) seems to be coming from a rule or a custom DB script.
Can you check the rules for one maybe doing an external HTTP request thatās ending in a 401? Try disabling rules one by one to see if the error disappears. If you have a custom DB, also check the script to make sure itās working.
In the script of the gitlab integration i allways get the error of āerrorā: āinvalid_requestā
here is the script, if i make the request with postman with the access_token its worksā¦
function(access_token, ctx, callback) {
request.get(āhttps://gitlab.com/api/v4/userā, {
āheadersā: {
āAuthorizationā: 'Bearer ā + access_token,
}
}, function(err, resp, body) {
if (err) {
return callback('err ' + err);
return;
}
if (resp.statusCode !== 200) {
return callback(new Error('StatusCode:' + resp.statusCode));
}
return callback(JSON.parse(body));
});
}
Can you try this instead? (putting the URL together with the headers in one options
object):
var a = function(access_token, ctx, callback) {
request.get(
{
url: "https://gitlab.com/api/v4/user",
headers: {
Authorization: "Bearer " + access_token
}
},
function(err, resp, body) {
if (err) {
return callback("err " + err);
return;
}
if (resp.statusCode !== 200) {
return callback(new Error("StatusCode:" + resp.statusCode));
}
return callback(JSON.parse(body));
}
);
};
These script doesnāt work neither
if a use this script:
function(access_token, ctx, callback) {
request.get(āhttps://gitlab.com/api/v4/userā, {
āheadersā: {
āAuthorizationā: 'Bearer ā + access_token,
}
}, function(err, resp, body) {
if (err) {
return callback('err ' + err);
return;
}
if (resp.statusCode !== 200) {
return callback(new Error('StatusCode:' + resp.statusCode));
}
const u = JSON.parse(body);
const profile = {
user_id: u.id,
nickname: u.username,
email: u.email,
name: u.name,
given_name: u.name,
family_name: u.name,
picture: u.avatar_url
};
return callback(null, profile);
});
}
{
āstatusCodeā: 403,
ādataā: ā{"error":"invalid_grant","error_description":"Invalid authorization code"}ā
}
but the user gets created anyway
So again, i got it working on localhost but when i deploy mi solution to my domain its stop working all the integrations with no errorsā¦ the success exchange event is never happening
Ok so the problem was in the aws Amplify services with the redirect rules i have to delete all the rules and add
source
</[1]+$|.(?!(jsx|json|css|map|chunk.js|chunk.js.map|gif|ico|jpg|js|png|txt|svg|woff|ttf)$)([^.]+$)/>
Target address
/index.html
type
rewrite 200
-
^. ā©ļø
Cool to see that you have it figured out!
This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.