Support Questions

Find answers, ask questions, and share your expertise

CDSW CLI - login failed to authenticate on MacOS

avatar

Hi,

I have been using the cdswctl tool for a while for creating sessions that can be accessed by VS Code from Windows.

Today i tried to create a session from a Mac using the same command and it throws an error complaining that the API key is not valid.   I have checked the key and same key works fine from Windows.

The command i am using is :

./cdswctl login -n USERNAME -u http://cdsw.mydomain.xxxx/ -y APIKEY

Can anyone offer any advice?

Thanks

1 ACCEPTED SOLUTION

avatar

So - it is related to proxy/dns settings when on RAS.

Adding a lookup to etc/hosts from the IP address to the Host name has fixed my issue:

e.g.

# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost

192.99.90.1 cdsw.XXXXXX.xxxx

View solution in original post

11 REPLIES 11

avatar
Community Manager

@BubbaBoBobBrain Welcome to the Cloudera Community!

To help you get the best possible solution, I have tagged our CDSW experts @Gopinath @Mike  who may be able to assist you further.

Please keep us updated on your post, and we hope you find a satisfactory solution to your query.


Regards,

Diana Torres,
Community Moderator


Was your question answered? Make sure to mark the answer as the accepted solution.
If you find a reply useful, say thanks by clicking on the thumbs up button.
Learn more about the Cloudera Community:

avatar

Hi - i am still facing a blocker on this.  Can anyone offer any advice?

A colleague with a Mac has also tried and they get the same error:

Failed to authenticate for user <my user name> using provided API key.

Could it be due to case of the usernames?  In CDSW my username is uppercase and on my mac it is lower case?

I have tried putting my username in the login statement matching the case of my CDSW user.

avatar
Community Manager

@Scharan Any insights here? Thanks!


Regards,

Diana Torres,
Community Moderator


Was your question answered? Make sure to mark the answer as the accepted solution.
If you find a reply useful, say thanks by clicking on the thumbs up button.
Learn more about the Cloudera Community:

avatar
Expert Contributor

Hi @BubbaBoBobBrain , you need to include the workspace in your login command, see this page: https://docs.cloudera.com/cdsw/1.10.3/cli-reference/topics/cdsw-login-cdswctl.html

This command worked fine for me:
./cdswctl login -u https://mikes-cdsw.cloudera.com  -n mike -y u8ryf6a2977rfsr8zajesand2jhwoa44

Btw on Mac you usually need to first right click on the cdswcli icon and select "Open" - this will let you open the tool once which lets your mac system trust the application, which it won't do by default since it was downloaded from the internet. After this you can use it as normal.

avatar

Hi @Mike ,

Thank you for the reply. 

I have already trusted the the cdswctl application.

I can't see much difference between my command and yours?

The error i am getting is related to the API key.  If i remove the API key it prompts me for a password but then fails as we used SSO.

avatar
Expert Contributor

Oh weird the first time I read this I didn't see you using the server anywhere. No, the command you are using is correct.

Can you expand on this statement?

>Could it be due to case of the usernames?  In CDSW my username is uppercase and on my mac it is lower case?

The username you are using in the command is the CDSW username, not your mac username.

avatar

My Mac logon, home dir and the username at the end of the SSH public key is as follows:

a1234567

But in CDSW the username is:

A1234567

I didn't know if this would cause a conflict?  I have tried both A1234567 and a1234567 in the login statement.

 

avatar

I am in the office now rather than working remotely via VPN and it has worked ok. 😃

I will try again at home later and see if the VPN was causing an issue.

avatar
Expert Contributor

I would expect that you need to use A1234567 as that will be the username which matches the API key.

If the only thing that changed was the VPN... that must be the issue. Perhaps the VPN is blocking ssh access or rewriting some header or something? I'm pretty sure that the error about an invalid API key is not the real error - it likely cannot even get to your CML in the first place. When you get back on VPN, can you try to just cURL your server with and without VPN?