# Tigon Shiro ### Usage Define your `AuthRealm` ```java @Component public class AuthRealmSupport implements AuthRealm { @Autowired private TenantMapper tenantMapper; /** * {@inheritDoc} */ @Override public Credential credential(final String principal) { final Tenant tenant = tenantMapper.find( new Search(Tenant.ACCESS_KEY, principal)); if (tenant != null) { if (!tenant.getActive()) { throw new LockedAccountException("Account locked"); } final Credential credential = new Credential<>( tenant.getAccessSecret(), principal); credential.setExtra(tenant); return credential; } return null; } /** * {@inheritDoc} */ @Override public boolean credentialMatch(final Object password, final Credential credential) { return credential.getCredential().equals(password); } } ```