Skip to main content
Seasoned ⭐️⭐️
February 2, 2023
Solved

Error - Authentication via Client Secret in Training

  • February 2, 2023
  • 11 replies
  • 222 views

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 .

    Best answer by Sofie Haug

    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

    11 replies

    Sofie Haug
    Expert ⭐️⭐️⭐️⭐️
    Cognite Academy Instructor
    February 2, 2023

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

    Sofie | Cognite Academy
    Sofie Haug
    Expert ⭐️⭐️⭐️⭐️
    Cognite Academy Instructor
    February 2, 2023

    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

    Sofie | Cognite Academy
    Seasoned ⭐️⭐️
    February 2, 2023

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

    Sofie Haug
    Expert ⭐️⭐️⭐️⭐️
    Cognite Academy Instructor
    February 3, 2023

    @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 :) 

    Sofie | Cognite Academy
    Seasoned ⭐️⭐️
    February 3, 2023

    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

     

    Seasoned ⭐️⭐️
    February 3, 2023

     

    Practitioner ⭐️⭐️⭐️
    February 3, 2023

    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

    Seasoned ⭐️⭐️
    February 6, 2023

    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. 

    Sofie Haug
    Expert ⭐️⭐️⭐️⭐️
    Cognite Academy Instructor
    February 6, 2023

    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 

    Sofie | Cognite Academy
    Expert ⭐️⭐️⭐️⭐️
    February 6, 2023

    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