Solved

Error - Authentication via Client Secret in Training


Badge +4

Course name - Learn to Use the Cognite Python SDK
 

File name - 1_Authentication.ipynb

Giving error - CogniteAuthError: Error generating access token: invalid_client, 401, AADSTS7000215: Invalid client secret provided. Ensure the secret being sent in the request is the client secret value, not the client secret ID, for a secret added to app 'fab52bb5-9de2-4f9e-aefa-712da4b5fe00'. Trace ID: f02d8b23-9bee-47ae-8cae-880d1db31100 Correlation ID: 4ea3847d-20ef-4548-be07-9ffb86f58451 Timestamp: 2023-02-02 10:58:52Z

Can someone help me resolve the same .

icon

Best answer by Sofie Haug 2 February 2023, 14:01

View original

11 replies

Userlevel 3
Badge +6

Hi @vidhi.c.jain, could you tell me the line of code that throws this error?

Userlevel 3
Badge +6

Hi again @vidhi.c.jain! You’re not given an client secret for this course. 
Notebook 1 shows different methods of authenticating and states that to use client secret “Make Sure, You've created an environment variable CLIENT_SECRET with the value of the client secret obtained from admin”

So basically the code is there to show it’s down if you wanted to authenticate using a client secret, but it not asking you to do it. Going forward with notebook 2 it is not needed. 

I hope that answered you question and that you have a smooth experience with the rest of the course.

 

Sofie

Badge +4

Hi @Sofie Haug , i am getting same error in notebook  2_List_Search_Retrieve cmd -5 (c.data_sets.list())

Userlevel 3
Badge +6

@vidhi.c.jain could you try to reset the kernel and re-run every cell in notebook 2. Please let me know how that goes :) 

Badge +4

Hi @Sofie Haug  i have resetted the kernel and reran the cells 

Throwing same runtime error

here are some detailed logs may be this might help

 

Badge +4

 

Userlevel 4
Badge

Hi there! Have you tried to do what the error message suggests? 😊

Error: The ID token is not yet valid. Make sure your computer’s time and time zone are both correct

Badge +4

Hi @Håkon V. Treider , yes before for some time i had this timezone difference ,i got it solved and then reran the same. 
From my perspective, in interactive login there is a difference between the usename its getting i.e = jain,vidhi but its expecting vidhi.c.jain@accenture.com which is my mail id . I have registered in cognite-hub using “vidhi.c.jain” as username , Is there any way that i can change my username . Probably then i might be able to login. 

Userlevel 3
Badge +6

If you want to change your name, I think @Carin Meems could help you with that?
Or you could send a ticket/mail to support@cognite.com 

Userlevel 3

Hi @vidhi.c.jain

The Jain, Vidhi that you see is the display name in the IDP that is linked to your email address, as you can see in the preferred_username part of the error. That is separate from the username that you register in Hub. The Hub username is just a display name in this frontend. Logging in is all managed via your initial signup to the Azure tenant, i.e. your email address, so I don’t believe changing your username in Hub will make any difference for the error that you see?

Best,

Carin

Userlevel 3
Badge +6

I agree with @Carin Meems! I think @vidhi.c.jain  you need to check the clock on your computer, maybe it is just off with 1 minute?

I found a lot of similar issues on the internet (for example here: https://github.com/Azure/azure-cli/issues/20388)
where one person says: 
 

For the record, I was also facing this issue, even after synchronizing my machine's time. Only after an additional reboot the problem went away.

 

Could you try that @vidhi.c.jain ?

Reply