You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Every time I connect to SQL with a new token it should work.
I connect on SQL using the azure active directory where I use idToken to get an access token on user behalf to access the DB
var data = qs.stringify({
'grant_type': 'urn:ietf:params:oauth:grant-type:jwt-bearer',
'client_id': '2cc13032-21b-XXX',
'client_secret': 'XXAhCu~XX',
'assertion': idToken,
'scope': 'https://database.windows.net//.default',
'requested_token_use': 'on_behalf_of'
});
var configs = {
method: 'post',
url: 'https://login.microsoftonline.com/a5eda077-a7ca-4345-9a0b-b2/oauth2/v2.0/token',
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
},
data: data
};
// https://github.com/tediousjs/tedious/blob/master/examples/transaction.js
return axios(configs);
after getting the the access token from the above code then I pass it to the SQL to connect
The first time when server start it works which means on Azure active directory side permission are propper set
Actual behaviour:
After some time it shows Login failed for user ''. Token is expired even when I know I am passing a
new token. unless I kill the server and restart it the error keeps showing, my question why this error when on mssql side I am passing a token that I know it has not expired?
Expected behavior:
Every time I connect to SQL with a new token it should work.
I connect on SQL using the azure active directory where I use idToken to get an access token on user behalf to access the DB
after getting the the access token from the above code then I pass it to the SQL to connect
The first time when server start it works which means on Azure active directory side permission are propper set
Actual behaviour:
After some time it shows Login failed for user ''. Token is expired even when I know I am passing a
new token. unless I kill the server and restart it the error keeps showing, my question why this error when on mssql side I am passing a token that I know it has not expired?
Configuration:
"mssql": "^7.1.3",
"next js":latest
Software versions
@dhensby please help me.
The text was updated successfully, but these errors were encountered: