using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
namespace MyAppNamespace.Controllers
[Route("/api/auth/rownd")]
public class RowndAuthController : RowndCookieExchange
protected override async Task IsAllowedToSignIn(RowndUser rowndUser) {
// Run any custom logic here to ensure this user should be allowed to sign in.
// return; // if everything is fine
// throw new Exception("You aren't allowed here!"); // if you want to prevent the user from signing in
public RowndAuthController(RowndClient client, ILogger<RowndAuthController> logger, UserManager<IdentityUser> userManager) : base(client, logger)
_userManager = userManager; // If provided, Rownd will attempt to match the incoming user with an existing user in the database.
_addNewUsersToDatabase = true; // If you want Rownd to add new users to the database when they're first authenticated, set this to `true` (requires `_userManager`)
_defaultAuthenticationScheme = IdentityConstants.ApplicationScheme; // Sets the authentication scheme (default: `IdentityConstants.ApplicationScheme`)
_signOutRedirectUrl = "/"; // Where to redirect the user after signing out (default: "/")