Bir Node.js uygulamasında yazıyorum ve kimlik doğrulaması almak için bir ADFS sunucusunu entegre etmeye çalışıyorum. Bunun için wstrust-client
kullanıyorum ve ADFS Sunucu URL'sini son noktam olarak kullanıyorum. Kodum şimdiye kadar: Ben rica ediyorumHTTP 400: ADFS HTTPS İstekte Hatalı İstek hatası
app.get('/login', function(req, res) {
trustClient.requestSecurityToken({
scope: 'https://mycompany.com',
username: "username",
password: "password",
endpoint: 'https://[adfs server]/adfs/services/trust/13/usernamemixed'
}, function (rstr) {
// Access the token
var rawToken = rstr.token;
console.log('raw: ' + rawToken);
}, function(error) {
console.log(error)
});
});
https
wstrustclient.js
Benim kod şimdiye kadar olduğu wstrust-client
içinden: Ancak
var req = https.request(post_options, function(res) {
res.setEncoding('utf8');
res.on('data', function(data) {
console.log("Entered res")
var rstr = {
token: parseRstr(data),
response: res,
};
callback(rstr);
});
});
req.write(message);
req.end();
req.on('error', function (e) {
console.log("******************************");
console.log(e);
console.log("******************************");
, bu hatayı atıyor:
******************************
{ [Error: UNABLE_TO_VERIFY_LEAF_SIGNATURE]
stack: 'Error: UNABLE_TO_VERIFY_LEAF_SIGNATURE\n
at SecurePair.<anonymous> (tls.js:1253:32)\n
at SecurePair.EventEmitter.emit (events.js:91:17)\n
at SecurePair.maybeInitFinished (tls.js:865:10)\n
at CleartextStream.read [as _read] (tls.js:416:15)\n
at CleartextStream.Readable.read (_stream_readable.js:231:10)\n
at EncryptedStream.write [as _write] (tls.js:329:25)\n
at EncryptedStream.Writable.write (_stream_writable.js:176:8)\n
at write (_stream_readable.js:496:24)\n
at flow (_stream_readable.js:506:7)\n
at Socket.pipeOnReadable (_stream_readable.js:538:5)' }
******************************
******************************
{ [Error: read ECONNRESET]
stack: 'Error: read ECONNRESET\n
at errnoException (net.js:846:11)\n
at TCP.onread (net.js:508:19)',
code: 'ECONNRESET',
errno: 'ECONNRESET',
syscall: 'read' }
******************************
Bir tarayıcıda aynı son nokta URL'sine göz attığımda, HTTP 400: Bad Request
Bu bir SSL türü hatası olduğunu ve sunucu tarafında olduğunu biliyorum. Ancak, neden hata attığını ve sunucu tarafında neyin yanlış olabileceğini bilmiyorum. Neyi değiştirmem gerekiyor? OpenSSL kılavuzda here gereğince