brownad / homebridge-zoe

Homebridge plugin for Renault ZOE
7 stars 6 forks source link

Error Login #1

Open karad0 opened 4 years ago

karad0 commented 4 years ago

Hi, I have a error, but the login it's correct. Look

`[2/2/2020, 10:18:13 AM] [Renault ZOE] Login Error [2/2/2020, 10:18:13 AM] [Renault ZOE] { status: 403, statusText: 'Forbidden', headers: { date: 'Sun, 02 Feb 2020 09:18:13 GMT', server: 'Apache', 'x-frame-options': 'SAMEORIGIN', 'access-control-allow-origin': 'https://services.renault-ze.com', 'access-control-allow-credentials': 'true', 'access-control-allow-methods': 'POST, PUT, GET, OPTIONS, DELETE', 'access-control-allow-headers': 'x-requested-with, content-type, accept, authorization, x-xsrf-token, if-modified-since', 'access-control-max-age': '3600', 'x-application-context': 'application:prod', vary: 'Accept-Encoding', connection: 'close', 'transfer-encoding': 'chunked', 'content-type': 'application/json;charset=UTF-8' }, config: { url: 'https://www.services.renault-ze.com/api/user/login', method: 'post', data: '{"username":"####","password":"####"}', headers: { Accept: 'application/json, text/plain, /', 'Content-Type': 'application/json;charset=utf-8', 'User-Agent': 'axios/0.19.2', 'Content-Length': 58 }, transformRequest: [ [Function: transformRequest] ], transformResponse: [ [Function: transformResponse] ], timeout: 0, adapter: [Function: httpAdapter], xsrfCookieName: 'XSRF-TOKEN', xsrfHeaderName: 'X-XSRF-TOKEN', maxContentLength: -1, validateStatus: [Function: validateStatus] }, request: ClientRequest { _events: [Object: null prototype] { socket: [Function], abort: [Function], aborted: [Function], error: [Function], timeout: [Function], prefinish: [Function: requestOnPrefinish] }, _eventsCount: 6, _maxListeners: undefined, outputData: [], outputSize: 0, writable: true, _last: true, chunkedEncoding: false, shouldKeepAlive: false, useChunkedEncodingByDefault: true, sendDate: false, _removedConnection: false, _removedContLen: false, _removedTE: false, _contentLength: null, _hasBody: true, _trailer: '', finished: true, _headerSent: true, socket: TLSSocket { _tlsOptions: [Object], _secureEstablished: true, _securePending: false, _newSessionPending: false, _controlReleased: true, _SNICallback: null, servername: 'www.services.renault-ze.com', alpnProtocol: false, authorized: true, authorizationError: null, encrypted: true, _events: [Object: null prototype], _eventsCount: 9, connecting: false, _hadError: false, _parent: null, _host: 'www.services.renault-ze.com', _readableState: [ReadableState], readable: true, _maxListeners: undefined, _writableState: [WritableState], writable: false, allowHalfOpen: false, _sockname: null, _pendingData: null, _pendingEncoding: '', server: undefined, _server: null, ssl: [TLSWrap], _requestCert: true, _rejectUnauthorized: true, parser: null, _httpMessage: [Circular],

}, connection: TLSSocket { _tlsOptions: [Object], _secureEstablished: true, _securePending: false, _newSessionPending: false, _controlReleased: true, _SNICallback: null, servername: 'www.services.renault-ze.com', alpnProtocol: false, authorized: true, authorizationError: null, encrypted: true, _events: [Object: null prototype], _eventsCount: 9, connecting: false, _hadError: false, _parent: null, _host: 'www.services.renault-ze.com', _readableState: [ReadableState], readable: true, _maxListeners: undefined, _writableState: [WritableState], writable: false, allowHalfOpen: false, _sockname: null, _pendingData: null, _pendingEncoding: '', server: undefined, _server: null, ssl: [TLSWrap], _requestCert: true, _rejectUnauthorized: true, parser: null, _httpMessage: [Circular],

}, _header: 'POST /api/user/login HTTP/1.1 ' + 'Accept: application/json, text/plain, / ' + 'Content-Type: application/json;charset=utf-8 ' + 'User-Agent: axios/0.19.2 ' + 'Content-Length: 58 ' + 'Host: www.services.renault-ze.com ' + 'Connection: close ' + ' ', _onPendingData: [Function: noopPendingOutput], agent: Agent { _events: [Object: null prototype], _eventsCount: 1, _maxListeners: undefined, defaultPort: 443, protocol: 'https:', options: [Object], requests: {}, sockets: [Object], freeSockets: {}, keepAliveMsecs: 1000, keepAlive: false, maxSockets: Infinity, maxFreeSockets: 256, maxCachedSessions: 100, _sessionCache: [Object] }, socketPath: undefined, method: 'POST', path: '/api/user/login', _ended: true, res: IncomingMessage { _readableState: [ReadableState], readable: false, _events: [Object: null prototype], _eventsCount: 3, _maxListeners: undefined, socket: [TLSSocket], connection: [TLSSocket], httpVersionMajor: 1, httpVersionMinor: 1, httpVersion: '1.1', complete: true, headers: [Object], rawHeaders: [Array], trailers: {}, rawTrailers: [], aborted: false, upgrade: false, url: '', method: null, statusCode: 403, statusMessage: 'Forbidden', client: [TLSSocket], _consuming: true, _dumped: false, req: [Circular], responseUrl: 'https://www.services.renault-ze.com/api/user/login', redirects: [] }, aborted: false, timeoutCb: null, upgradeOrConnect: false, parser: null, maxHeadersCount: null, _redirectable: Writable { _writableState: [WritableState], writable: true, _events: [Object: null prototype], _eventsCount: 2, _maxListeners: undefined, _options: [Object], _redirectCount: 0, _redirects: [], _requestBodyLength: 58, _requestBodyBuffers: [], _onNativeResponse: [Function], _currentRequest: [Circular], _currentUrl: 'https://www.services.renault-ze.com/api/user/login' },

[Symbol(kOutHeaders)]: [Object: null prototype] { accept: [Array], 'content-type': [Array], 'user-agent': [Array], 'content-length': [Array], host: [Array] } }, data: { code: 403900, message: 'com.worldline.renault.myzeonline.user.exception.RestrictedCountryException', timestamp: 1580635093602, redirectURLs: { appstore: 'https://myr.renault.fr/ze-redirection.html?os=ios', playstore: 'https://myr.renault.fr/ze-redirection.html?os=android', website: 'https://myr.renault.fr/ze-redirection.html?os=web' }, locale: 'fr_FR' } }`

brownad commented 4 years ago

Can you login to

https://www.services.renault-ze.com/api/user/login

Manually that is..

Possible Renault has multiple registration sites for its services.

On 2 Feb 2020, at 09:20, karad0 notifications@github.com wrote:

Hi, I have a error, but the login it's correct. Look

[2/2/2020, 10:18:13 AM] [Renault ZOE] Login Error [2/2/2020, 10:18:13 AM] [Renault ZOE] { status: 403, statusText: 'Forbidden', headers: { date: 'Sun, 02 Feb 2020 09:18:13 GMT', server: 'Apache', 'x-frame-options': 'SAMEORIGIN', 'access-control-allow-origin': 'https://services.renault-ze.com', 'access-control-allow-credentials': 'true', 'access-control-allow-methods': 'POST, PUT, GET, OPTIONS, DELETE', 'access-control-allow-headers': 'x-requested-with, content-type, accept, authorization, x-xsrf-token, if-modified-since', 'access-control-max-age': '3600', 'x-application-context': 'application:prod', vary: 'Accept-Encoding', connection: 'close', 'transfer-encoding': 'chunked', 'content-type': 'application/json;charset=UTF-8' }, config: { url: 'https://www.services.renault-ze.com/api/user/login', method: 'post', data: '{"username":"####","password":"####"}', headers: { Accept: 'application/json, text/plain, /', 'Content-Type': 'application/json;charset=utf-8', 'User-Agent': 'axios/0.19.2', 'Content-Length': 58 }, transformRequest: [ [Function: transformRequest] ], transformResponse: [ [Function: transformResponse] ], timeout: 0, adapter: [Function: httpAdapter], xsrfCookieName: 'XSRF-TOKEN', xsrfHeaderName: 'X-XSRF-TOKEN', maxContentLength: -1, validateStatus: [Function: validateStatus] }, request: ClientRequest { _events: [Object: null prototype] { socket: [Function], abort: [Function], aborted: [Function], error: [Function], timeout: [Function], prefinish: [Function: requestOnPrefinish] }, _eventsCount: 6, _maxListeners: undefined, outputData: [], outputSize: 0, writable: true, _last: true, chunkedEncoding: false, shouldKeepAlive: false, useChunkedEncodingByDefault: true, sendDate: false, _removedConnection: false, _removedContLen: false, _removedTE: false, _contentLength: null, _hasBody: true, _trailer: '', finished: true, _headerSent: true, socket: TLSSocket { _tlsOptions: [Object], _secureEstablished: true, _securePending: false, _newSessionPending: false, _controlReleased: true, _SNICallback: null, servername: 'www.services.renault-ze.com', alpnProtocol: false, authorized: true, authorizationError: null, encrypted: true, _events: [Object: null prototype], _eventsCount: 9, connecting: false, _hadError: false, _parent: null, _host: 'www.services.renault-ze.com', _readableState: [ReadableState], readable: true, _maxListeners: undefined, _writableState: [WritableState], writable: false, allowHalfOpen: false, _sockname: null, _pendingData: null, _pendingEncoding: '', server: undefined, _server: null, ssl: [TLSWrap], _requestCert: true, _rejectUnauthorized: true, parser: null, _httpMessage: [Circular], [Symbol(res)]: [TLSWrap], [Symbol(asyncId)]: 32, [Symbol(kHandle)]: [TLSWrap], [Symbol(lastWriteQueueSize)]: 0, [Symbol(timeout)]: null, [Symbol(kBuffer)]: null, [Symbol(kBufferCb)]: null, [Symbol(kBufferGen)]: null, [Symbol(kBytesRead)]: 0, [Symbol(kBytesWritten)]: 0, [Symbol(connect-options)]: [Object] }, connection: TLSSocket { _tlsOptions: [Object], _secureEstablished: true, _securePending: false, _newSessionPending: false, _controlReleased: true, _SNICallback: null, servername: 'www.services.renault-ze.com', alpnProtocol: false, authorized: true, authorizationError: null, encrypted: true, _events: [Object: null prototype], _eventsCount: 9, connecting: false, _hadError: false, _parent: null, _host: 'www.services.renault-ze.com', _readableState: [ReadableState], readable: true, _maxListeners: undefined, _writableState: [WritableState], writable: false, allowHalfOpen: false, _sockname: null, _pendingData: null, _pendingEncoding: '', server: undefined, _server: null, ssl: [TLSWrap], _requestCert: true, _rejectUnauthorized: true, parser: null, _httpMessage: [Circular], [Symbol(res)]: [TLSWrap], [Symbol(asyncId)]: 32, [Symbol(kHandle)]: [TLSWrap], [Symbol(lastWriteQueueSize)]: 0, [Symbol(timeout)]: null, [Symbol(kBuffer)]: null, [Symbol(kBufferCb)]: null, [Symbol(kBufferGen)]: null, [Symbol(kBytesRead)]: 0, [Symbol(kBytesWritten)]: 0, [Symbol(connect-options)]: [Object] }, _header: 'POST /api/user/login HTTP/1.1 ' + 'Accept: application/json, text/plain, / ' + 'Content-Type: application/json;charset=utf-8 ' + 'User-Agent: axios/0.19.2 ' + 'Content-Length: 58 ' + 'Host: www.services.renault-ze.com ' + 'Connection: close ' + ' ', _onPendingData: [Function: noopPendingOutput], agent: Agent { _events: [Object: null prototype], _eventsCount: 1, _maxListeners: undefined, defaultPort: 443, protocol: 'https:', options: [Object], requests: {}, sockets: [Object], freeSockets: {}, keepAliveMsecs: 1000, keepAlive: false, maxSockets: Infinity, maxFreeSockets: 256, maxCachedSessions: 100, _sessionCache: [Object] }, socketPath: undefined, method: 'POST', path: '/api/user/login', _ended: true, res: IncomingMessage { _readableState: [ReadableState], readable: false, _events: [Object: null prototype], _eventsCount: 3, _maxListeners: undefined, socket: [TLSSocket], connection: [TLSSocket], httpVersionMajor: 1, httpVersionMinor: 1, httpVersion: '1.1', complete: true, headers: [Object], rawHeaders: [Array], trailers: {}, rawTrailers: [], aborted: false, upgrade: false, url: '', method: null, statusCode: 403, statusMessage: 'Forbidden', client: [TLSSocket], _consuming: true, _dumped: false, req: [Circular], responseUrl: 'https://www.services.renault-ze.com/api/user/login', redirects: [] }, aborted: false, timeoutCb: null, upgradeOrConnect: false, parser: null, maxHeadersCount: null, _redirectable: Writable { _writableState: [WritableState], writable: true, _events: [Object: null prototype], _eventsCount: 2, _maxListeners: undefined, _options: [Object], _redirectCount: 0, _redirects: [], _requestBodyLength: 58, _requestBodyBuffers: [], _onNativeResponse: [Function], _currentRequest: [Circular], _currentUrl: 'https://www.services.renault-ze.com/api/user/login' }, [Symbol(kNeedDrain)]: false, [Symbol(isCorked)]: false, [Symbol(kOutHeaders)]: [Object: null prototype] { accept: [Array], 'content-type': [Array], 'user-agent': [Array], 'content-length': [Array], host: [Array] } }, data: { code: 403900, message: 'com.worldline.renault.myzeonline.user.exception.RestrictedCountryException', timestamp: 1580635093602, redirectURLs: { appstore: 'https://myr.renault.fr/ze-redirection.html?os=ios', playstore: 'https://myr.renault.fr/ze-redirection.html?os=android', website: 'https://myr.renault.fr/ze-redirection.html?os=web' }, locale: 'fr_FR' } }

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

brownad commented 4 years ago

Answer is in the log

com.worldline.renault.myzeonline.user.exception.RestrictedCountryException

FR is you’re restricted country. I’m not aware of different endpoints for country enablement. If anyone does then this can be configured easily.

Sent from my iPhone

On 2 Feb 2020, at 09:20, karad0 notifications@github.com wrote:

com.worldline.renault.myzeonline.user.exception.RestrictedCountryException'

karad0 commented 4 years ago

I search! Maybe here https://github.com/jamesremuscat/pyze

karad0 commented 4 years ago

https://muscatoxblog.blogspot.com/2019/07/delving-into-renaults-new-api.html

karad0 commented 4 years ago

With Pyze method. it' ok. You can update? Capture d’écran 2020-02-02 à 12 13 05

brownad commented 4 years ago

Possibly but am still on the legacy UK API. Unless it works for all I don’t thinks rolled out here yet. Happy to take a PR

Sent from my iPhone

On 2 Feb 2020, at 11:14, karad0 notifications@github.com wrote:

With Pyze method. it' ok. You can update?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

karad0 commented 4 years ago

Pyze use the new api, and work for all.

brownad commented 4 years ago

Will have a look but short on time - welcome to make a PR if you want

Sent from my iPhone

On 2 Feb 2020, at 11:35, karad0 notifications@github.com wrote:

Pyze use the new api, and work for all.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.