Как обновить токен с помощью токена обновления в клиентском приложении MVC?C#

Место общения программистов C#
Ответить Пред. темаСлед. тема
Anonymous
 Как обновить токен с помощью токена обновления в клиентском приложении MVC?

Сообщение Anonymous »


There are two type of application in my solution 1)Web api application 2)MMC c# application

Here I created web api application which has facility of token authentication. In this Application username and password validating from SQL server database. i.e If any user request for web api token that user detail must be present in database table.(In user Table Id,Username,Password column are there with data). So my web api application connected to database server.

Now I created MVC c# application which consume web api and access the data. what I do here that when user put credential to mvc app login screen and that credential goes to api and validate them. Api will give response of data If user credential are correct.

Here I got JSON response from web api and data like "access_token","Expire_time","refresh_token" etc I stored all these detail in Session object.

So whenever I request for Getdata() from mvc app I passing 'access_token' to api and retuned result data.

I set web api token timeout 2 minutes.(token get deleted after 2 minutes)

So problem goes here that how I can maintain user login session in web api using refresh_token.I do not want to user again get login screen and come back to that screen. Because every 2 minutes he will get login screen which is not correct solution.

I want some function when api get timeout access_token and mvc application again call refresh_token and continue data transaction.


Источник: https://stackoverflow.com/questions/549 ... pplication
Реклама
Ответить Пред. темаСлед. тема

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

  • Похожие темы
    Ответы
    Просмотры
    Последнее сообщение

Вернуться в «C#»