electrode-ota-server icon indicating copy to clipboard operation
electrode-ota-server copied to clipboard

Could not get token in eclectrode-ota-server when click github auth

Open cjt-hsy opened this issue 6 years ago • 1 comments

here is the all message when i click github auth button:

It was successed in my local PC env. But did not work in Alibaba ECS.

The log i added is here:

image

On my local PC ,the err will appear twice ,and the third time err will be null ,then isAuthenticated will be true ,the auth token will be appear,but on Alibaba ECS the err will appear twice,both is not null ,then jump to homepage.

+++++++++++++++++++++ System Info: ++++++++++++++++

RunTime = 115d,8h,51m Type = Alibaba Cloud ECS Maker = Alibaba Cloud OS = Ubuntu 14.04.2 LTS Kernel = 3.13.0-32-generic Mem = 2509MB/7985MB CPUs = 1 1 2 Intel(R) Xeon(R) CPU E5-2682 v4 @ 2.50GHz ++++++++++++++++++++++ Notice: ++++++++++++++++++++ ====== err: { _eventListeners: { finish: { handlers: null, flags: [Object] }, peek: { handlers: null, flags: [Object] } }, _notificationsQueue: [], _eventsProcessing: false, _sourcePodiums: [], onPodiumError: null, request: { _eventListeners: { finish: [Object], peek: [Object], disconnect: [Object] }, _notificationsQueue: [], _eventsProcessing: false, _sourcePodiums: [], onPodiumError: [Function], _bench: { ts: 9967660841.46674 }, connection: { _eventListeners: [Object], _notificationsQueue: [], _eventsProcessing: false, _sourcePodiums: [Array], onPodiumError: null, settings: [Object], server: [Object], type: 'tcp', _started: true, _connections: [Object], _onConnection: [Function], registrations: [Object], _extensions: [Object], _requestCounter: [Object], _load: [Object], _compression: [Object], states: [Object], auth: [Object], _router: [Object], plugins: {}, app: {}, listener: [Object], info: [Object] }, server: { _settings: [Object], _caches: [Object], _handlers: [Object], _methods: [Object], _events: [Object], _dependencies: [Array], _registrations: [Object], _heavy: [Object], _mime: [Object], _replier: [Object], _requestor: [Object], _decorations: [Object], decorations: [Object], _plugins: [Object], _app: [Object], _registring: false, _state: 'started', _extensionsSeq: 48, _extensions: [Object], _eventListeners: [Object], _notificationsQueue: [], _eventsProcessing: false, _sourcePodiums: [], onPodiumError: null, _parent: null, root: [Object], app: [Object], connections: [Array], load: [Object], methods: {}, mime: [Object], plugins: [Object], settings: [Object], version: '16.6.3', realm: [Object], auth: [Object], cache: [Object], info: [Object], listener: [Object], registrations: [Object], views: [Function], render: [Function] }, url: Url { protocol: null, slashes: null, auth: null, host: null, port: null, hostname: null, hash: null, search: '?hostname=', query: [Object], pathname: '/auth/login/github', path: '/auth/login/github?hostname=', href: '/auth/login/github?hostname=' }, query: { hostname: '' }, path: '/auth/login/github', method: 'get', mime: null, headers: { host: 'inte-codepush-ota.cloud.xxx.com', 'x-forwarded-for': '10.254.245.18', 'x-real-ip': '10.254.245.18', connection: 'close', 'upgrade-insecure-requests': '1', 'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', accept: 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8', referer: 'http://inte-codepush-ota.cloud.xxx.com/auth/login', 'accept-encoding': 'gzip, deflate', 'accept-language': 'zh-CN,zh;q=0.9,en;q=0.8', cookie: 'wm-ota-auth=Fe26.2fe119c8f986b625c168df6d45243fab2f76f9a0a789a2846e66966763e909886HNQzzyJkJi1GDJVsSbEevQ___f7abF-Wfa5v3bxj2uJOGlRKxPxrQ0OWjVeljP6jyJNyDcP4eJRNOyomPEe5Ct1xJFXpXUI-ub67zWYP2jQwf43c0bf1c8abf80d2e72ce434e8724d975460fa6858aa226202b21eae4951229RtxgOw2mTiWA4dIAZfXxwsZxSYtZkID85zQLloMGg9Q; sajssdk_2015_cross_new_user=1; sensorsdata2015jssdkcross=%7B%22distinct_id%22%3A%22164b58fdaa617d-04138bc2e86ecd-16386952-1296000-164b58fdaa7b12%22%2C%22%24device_id%22%3A%22164b58fdaa617d-04138bc2e86ecd-16386952-1296000-164b58fdaa7b12%22%2C%22props%22%3A%7B%22%24latest_referrer%22%3A%22%22%2C%22%24latest_referrer_host%22%3A%22%22%7D%7D; gr_user_id=317cef48-a22b-4191-ab00-1bb5a710724e; bell-github=Fe26.2cd56b2fb0011cd72cc519482c30079df49d78ce731a5c2543ef52356b95436d49IpzRoOL9JP-mwKmeOfxhgMPPzBx3En-ahkUeBVLmDiUV4-20m2KnqXgg6td724Uo7FvLJUIc1ihVGLB6Tx9pFLnGsBqJ6uTtpQ_A5yUAqEAfd55e3556ccdbd9431b7bcf3a158f94cc9ed3d24759e03e977208574dc8b4795kQsXpyLi2XN05bvRIR68VuiNBl3Qf8mosKnag82IKwE' }, info: { received: 1532097401481, responded: 0, remoteAddress: '172.16.200.49', remotePort: 51605, referrer: 'http://inte-codepush-ota.cloud.xxx.com/auth/login', host: 'inte-codepush-ota.cloud.xxx.com', hostname: 'inte-codepush-ota.cloud.xxx.com', acceptEncoding: 'gzip', cors: [Object] }, setUrl: undefined, setMethod: undefined, id: '1532097401481:iZ2zefhyq9foljgv430a2bZ:18735:jju1gdox:10031', app: {}, plugins: {}, _route: { settings: [Object], connection: [Object], server: [Object], path: '/auth/login/github', method: 'get', plugin: [Object], _special: false, _analysis: [Object], params: [], fingerprint: '/auth/login/github', public: [Object], _prerequisites: null, _extensions: [Object], _cycle: [Array] }, route: { method: 'get', path: '/auth/login/github', vhost: undefined, realm: [Object], settings: [Object], fingerprint: '/auth/login/github', auth: [Object] }, auth: { isAuthenticated: false, credentials: null, artifacts: null, strategy: null, mode: 'required', error: null }, pre: {}, preResponses: {}, orig: {}, params: {}, paramsArray: [], payload: null, state: { 'wm-ota-auth': [Object], sajssdk_2015_cross_new_user: '1', sensorsdata2015jssdkcross: '%7B%22distinct_id%22%3A%22164b58fdaa617d-04138bc2e86ecd-16386952-1296000-164b58fdaa7b12%22%2C%22%24device_id%22%3A%22164b58fdaa617d-04138bc2e86ecd-16386952-1296000-164b58fdaa7b12%22%2C%22props%22%3A%7B%22%24latest_referrer%22%3A%22%22%2C%22%24latest_referrer_host%22%3A%22%22%7D%7D', gr_user_id: '317cef48-a22b-4191-ab00-1bb5a710724e', 'bell-github': [Object] }, jsonp: null, response: null, raw: { req: [Object], res: [Object] }, addTail: [Function], tail: [Function], _states: { 'bell-github': [Object] }, _entity: {}, _logger: [], _allowInternals: false, _expectContinue: false, _isPayloadPending: false, _isBailed: false, _isReplied: false, _isFinalized: false, _tails: {}, _tailIds: 0, _protect: { _error: null, logger: [Object], domain: [Object] }, domain: Domain { domain: null, _events: [Object], _eventsCount: 1, _maxListeners: undefined, members: [] }, _onEnd: [Function], _onClose: [Function], _onError: [Function], _onAbort: [Function], render: [Function], cookieAuth: CookieAuth { set: [Function], clear: [Function], ttl: [Function], reply: [Object] } }, statusCode: 302, headers: { location: 'https://github.com/login/oauth/authorize?client_id=42b32fd81d12200d99ff&response_type=code&redirect_uri=http%3A%2F%2Finte-codepush-ota.cloud.xxx.com%3A9001%2Fauth%2Flogin%2Fgithub&state=ddkCEje2RzzTZpQ3i3PHof&scope=user%3Aemail' }, variety: 'plain', source: null, app: {}, plugins: {}, send: null, hold: undefined, settings: { encoding: 'utf8', charset: 'utf-8', ttl: null, stringify: null, passThrough: true, varyEtag: false, message: null }, _payload: null, _takeover: false, _contentEncoding: null, _contentType: null, _error: null, _processors: { marshal: undefined, prepare: undefined, close: undefined }, temporary: [Function], permanent: [Function], rewritable: [Function] } { requestId: '1532097402227:iZ2zefhyq9foljgv430a2bZ:18735:jju1gdox:10034', method: 'get', url: Url { protocol: null, slashes: null, auth: null, host: null, port: null, hostname: null, hash: null, search: '', query: {}, pathname: '/auth/login', path: '/auth/login', href: '/auth/login' }, headers: { host: 'inte-codepush-ota.cloud.xxx.com', 'x-forwarded-for': '10.254.245.18', 'x-real-ip': '10.254.245.18', connection: 'close', 'upgrade-insecure-requests': '1', 'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', accept: 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8', referer: 'http://inte-codepush-ota.cloud.xxx.com/auth/login', 'accept-encoding': 'gzip, deflate', 'accept-language': 'zh-CN,zh;q=0.9,en;q=0.8', cookie: 'wm-ota-auth=Fe26.2fe119c8f986b625c168df6d45243fab2f76f9a0a789a2846e66966763e909886HNQzzyJkJi1GDJVsSbEevQ___f7abF-Wfa5v3bxj2uJOGlRKxPxrQ0OWjVeljP6jyJNyDcP4eJRNOyomPEe5Ct1xJFXpXUI-ub67zWYP2jQwf43c0bf1c8abf80d2e72ce434e8724d975460fa6858aa226202b21eae4951229RtxgOw2mTiWA4dIAZfXxwsZxSYtZkID85zQLloMGg9Q; sajssdk_2015_cross_new_user=1; sensorsdata2015jssdkcross=%7B%22distinct_id%22%3A%22164b58fdaa617d-04138bc2e86ecd-16386952-1296000-164b58fdaa7b12%22%2C%22%24device_id%22%3A%22164b58fdaa617d-04138bc2e86ecd-16386952-1296000-164b58fdaa7b12%22%2C%22props%22%3A%7B%22%24latest_referrer%22%3A%22%22%2C%22%24latest_referrer_host%22%3A%22%22%7D%7D; gr_user_id=317cef48-a22b-4191-ab00-1bb5a710724e; bell-github=Fe26.27bda489af295747086b7e33f8f493e4139585f4bf51505835164c2ccdb66f9b0w3YKn8YsM7rTePHjcu5xtAWmppvZVzCcDsp8uGN-3YmbIcK4ZuZc9UXB5nv9oNzdkFj0GLBCUVGY1kZ37CZVbRKBsLRa4CVnTZADAxkKDlQQff786ff56ee410575ae5aa288dec96896b53e566d9b77e783f78aa41f0910515AahGN5UF0D4jYPkZ0isY8ZTeZpkls_1E7M0HWY3Mj8Q' }, remoteAddress: '172.16.200.49', remotePort: 51632 } 'auth request' ''

cjt-hsy avatar Jul 20 '18 14:07 cjt-hsy

The configuration for your local dev environment and the AWS should be different. You will have to ensure it loads the AWS configuration on the AWS environment. It might be loading the dev configuration in the AWS environment. Also, make sure you register your app with github.

datvong-wm avatar Sep 01 '18 01:09 datvong-wm