we are making use of AuthenticateAsync() as below. We are calling the below functions
public abstract override Task<object> **AuthenticateAsync**(IServiceBase authService, IAuthSession session, Authenticate request, CancellationToken token=default);
and then calling Init() which Sets the CallbackUrl and session.ReferrerUrl if not set and initializes the session tokens for the AuthProvider
protected IAuthTokens **Init**(IServiceBase authService, ref IAuthSession session, Authenticate request)
and then we make a call to GetAbsoluteUrl() to get the redirect url
public static string **GetAbsoluteUrl**(this IRequest httpReq, string url)
and we make a call to AddAuthToken() to add AccessToken, RefreshToken, RequestToken to the session
session.AddAuthToken(tokens)
and then we are calling SaveSessionAsync()
public static async Task **SaveSessionAsync**(this IAuthProvider provider, IServiceBase authService, IAuthSession session, TimeSpan? sessionExpiry = null, CancellationToken token=default)
public virtual async Task<IHttpResult> **OnAuthenticatedAsync**(IServiceBase authService, IAuthSession session, IAuthTokens tokens, Dictionary<string, string> authInfo, CancellationToken token=default)
protected virtual AuthContext **CreateAuthContext**(IServiceBase authService=null, IAuthSession session=null, IAuthTokens tokens=null)
override method from ServiceStack AuthenticateAsync will take care of the authentication process, we are expecting to change the session token after successful login. If I use
authService.Request.GenerateNewSessionCookiesAsync(session);
before calling OnAuthenticatedAsync() it is working.
Is this the correct way to handle this? Could you please suggest us the best way to handle this?