sonata-nfv / son-cli

SONATA SDK command line interface tools
http://www.sonata-nfv.eu/
Apache License 2.0
3 stars 11 forks source link

son-access auth token not active for push #259

Open edmaas opened 6 years ago

edmaas commented 6 years ago

Tested on a machine with the sonata service platform installed and running. Tested with several different topologies (demo topology in son-tutorials upb-emulator-mano-integration-demo, profiling.py in son-emu examples, sonata_simple_topology in son-emu examples) When creating a token with "son-access auth", it is rejected when uploading a package via "son-access push --upload " with the error message: 401:Unauthorized token is not active son-access-push error.txt son-workspace-configuration.txt

mpeuster commented 6 years ago

Was this tested against the emulator's dummy gatekeeper or against the service platform? Against the service platform right? Maybe you need to specify the target platform during authentication and push manually to make sure the right one is picked? But this is just a guess.

Maybe @lconceicao or @dang03 knows more?

dang03 commented 6 years ago

Hello edmaas, I've been analyzing the files you provided. Just as mpauster said, you probably need to specify the platform you are login to during the authentication. To do that, I recommend you to remove the 'sp1' platform that comes configured as default in the son-workspace-configuration.txt and just leave the 'ServicePlatform' you defined. Then, set it as default using the next command: $ son-access config --platform_id ServicePlatform --default

Having this platform by default should be enough, but in order to be sure of the platform you authenticate to, you can use the next command: $ son-access --platform ServicePlatform auth

Again, when pushing a package to the platform, indicate the platform name in the command: $ son-access --platform ServicePlatform push --upload /path/to/file

I hope this can help you