`SSO authentication in AD with javascript?
D
D
Dimka Matsi2020-03-10 10:10:04
JavaScript
Dimka Matsi, 2020-03-10 10:10:04

SSO authentication in AD with javascript?

I have a url with parameters:

const locationHREF : string = `${authEndpoint}?scope=${scope}&response_type=${response_type}&client_id=${client_id}&redirect_uri=${redirect_uri}`;

In the code, I redirect to the SSO server, where I request a nickname and password, then I call back to my application, where I get in the URL:
'https://некий.урл/роут#access_token=eyJ4NXQ.eyJzdWIHNr.Wco270magWq&token_type=Bearer&expires_in=43599&session_state=4b774c'

I put access_token in localstorage and store it there. But I'm not sure if I'm doing it right.

I also need to check for the validity of the token. I calculate its lifetime like this , but again I don't know where to store it, and how to do it safely. I had problems writing the authentication on the client, and I don't seem to understand everything, and I can't properly structure and write the config. I will be glad if someone who knows will share information with me. Thank you) Date.now() + (expires_in * 1000)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Ivan Shumov, 2020-03-10
@inoise

You do everything right

A
Alexander Ataakgayev, 2020-03-10
@badJaguar

You are doing everything right. It is better to store all this data in local storage than in cookies. Therefore, do not worry)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question