/// <summary> /// Challenges <see cref="IUserSimpleCodeInfo"/> data to identify a user. /// Note that a successful challenge may have side effects such as updating claims, access tokens or other data /// related to the user and this provider. /// </summary> /// <param name="ctx">The call context to use.</param> /// <param name="info">The payload to challenge.</param> /// <param name="actualLogin">Set it to false to avoid login side-effect (such as updating the LastLoginTime) on success.</param> /// <returns>The login result.</returns> public LoginResult LoginUser(ISqlCallContext ctx, IUserSimpleCodeInfo info, bool actualLogin = true) { var mode = actualLogin ? UCLMode.UpdateOnly | UCLMode.WithActualLogin : UCLMode.UpdateOnly | UCLMode.WithCheckLogin; var r = UserSimpleCodeUCL(ctx, 1, 0, info, mode); return(r.LoginResult); }
protected abstract UCLResult UserSimpleCodeUCL( ISqlCallContext ctx, int actorId, int userId, [ParameterSource] IUserSimpleCodeInfo info, UCLMode mode);
/// <summary> /// Creates or updates a user entry for this provider. /// This is the "binding account" feature since it binds an external identity to /// an already existing user that may already be registered into other authencation providers. /// </summary> /// <param name="ctx">The call context to use.</param> /// <param name="actorId">The acting actor identifier.</param> /// <param name="userId">The user identifier that must be registered.</param> /// <param name="info">Provider specific data: the <see cref="IUserSimpleCodeInfo"/> poco.</param> /// <param name="mode">Optionnaly configures Create, Update only or WithLogin behavior.</param> /// <returns>The operation result.</returns> public UCLResult CreateOrUpdateSimpleCodeUser(ISqlCallContext ctx, int actorId, int userId, IUserSimpleCodeInfo info, UCLMode mode = UCLMode.CreateOrUpdate) { return(UserSimpleCodeUCL(ctx, actorId, userId, info, mode)); }