Problem logging in

Added by Parviz 4 months ago

Hi. I'm trying to log in with Python using the test_program.py as provided here: https://github.com/nordnet/next-api-v2-examples/blob/master/python3/test_program.py

I'm not sure in which format I should provide username and password. So far I have tried the following formats:

1. python test_program.py 'username' 'password'
2. python test_program.py ['username'] ['password']
3. python test_program.py [username] [password]

In any of these methods I get the following error:

@<< HTTP request GET /next/2/ {
"message": "",
"system_running": true,
"timestamp": 1594045518774,
"valid_version": true
}
Logging in NEXT API...
<< HTTP request POST /next/2/login {
"code": "NEXT_LOGIN_INVALID_LOGIN_PARAMETER",
"message": "Something went wrong when logging in."
}@

The program seems to be working when I pass username and password as follows:

python test_program.py username password

But then it stops after this line:

Connecting to feed pub.api.test.nordnet.se:443...

These are the error messages:

TypeError: Cannot serialize socket object

OSError: [WinError 87] The parameter is incorrect

I would appreciate any help.


Replies (2)

RE: Problem logging in - Added by Parviz 4 months ago

This is the full error message I get:

C:\Users\parvi\Google Drive\Python\Nordnet>python test_program.py testerse qwerty
Checking NEXT API status...
<< HTTP request GET /next/2/ {
"message": "",
"system_running": true,
"timestamp": SOMETHING,
"valid_version": true
}
Logging in NEXT API...
<< HTTP request POST /next/2/login {
"country": "SE",
"environment": "exttest",
"expires_in": 300,
"private_feed": {
"encrypted": true,
"hostname": "priv.api.test.nordnet.se",
"port": 443
},
"public_feed": {
"encrypted": true,
"hostname": "pub.api.test.nordnet.se",
"port": 443
},
"session_key": "SOMEKEY"
}

Connecting to feed pub.api.test.nordnet.se:443...

Traceback (most recent call last):
File "test_program.py", line 210, in <module>
main()
File "test_program.py", line 185, in main
proc.start()
File "C:\Users\parvi\AppData\Local\Continuum\anaconda3\lib\multiprocessing\process.py", line 112, in start
self._popen = self._Popen(self)
File "C:\Users\parvi\AppData\Local\Continuum\anaconda3\lib\multiprocessing\context.py", line 223, in _Popen
return _default_context.get_context().Process._Popen(process_obj)
File "C:\Users\parvi\AppData\Local\Continuum\anaconda3\lib\multiprocessing\context.py", line 322, in _Popen
return Popen(process_obj)
File "C:\Users\parvi\AppData\Local\Continuum\anaconda3\lib\multiprocessing\popen_spawn_win32.py", line 89, in init
reduction.dump(process_obj, to_child)
File "C:\Users\parvi\AppData\Local\Continuum\anaconda3\lib\multiprocessing\reduction.py", line 60, in dump
ForkingPickler(file, protocol).dump(obj)
File "C:\Users\parvi\AppData\Local\Continuum\anaconda3\lib\socket.py", line 192, in getstate
raise TypeError("Cannot serialize socket object")
TypeError: Cannot serialize socket object

C:\Users\parvi\Google Drive\Python\Nordnet>Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\parvi\AppData\Local\Continuum\anaconda3\lib\multiprocessing\spawn.py", line 99, in spawn_main
new_handle = reduction.steal_handle(parent_pid, pipe_handle)
File "C:\Users\parvi\AppData\Local\Continuum\anaconda3\lib\multiprocessing\reduction.py", line 82, in steal_handle
_winapi.PROCESS_DUP_HANDLE, False, source_pid)
OSError: [WinError 87] The parameter is incorrect

RE: Problem logging in - Added by Alien 2 months ago

https://www.walgreenlistens.one/ Very important tips you share with us keep sharing more. Thank you.

(1-2/2)