public void Restricted_Scopes() { var validator = new ScopeValidator(_logger); var scopes = validator.ParseScopes("openid email resource1 resource2"); var result = validator.AreScopesAllowed(_restrictedClient, scopes); Assert.IsFalse(result); }
public void All_Scopes_Allowed_For_Restricted_Client() { var validator = new ScopeValidator(_logger); var scopes = validator.ParseScopes("openid resource1"); var result = validator.AreScopesAllowed(_restrictedClient, scopes); Assert.IsTrue(result); }
public void All_Scopes_Allowed_For_Restricted_Client() { var scopes = ScopeValidator.ParseScopesString("openid resource1"); var validator = new ScopeValidator(_store); var result = validator.AreScopesAllowed(_restrictedClient, scopes); result.Should().BeTrue(); }
public void Restricted_Scopes() { var scopes = ScopeValidator.ParseScopesString("openid email resource1 resource2"); var validator = new ScopeValidator(_store); var result = validator.AreScopesAllowed(_restrictedClient, scopes); result.Should().BeFalse(); }
public void All_Scopes_Allowed_For_Unrestricted_Client() { var validator = new ScopeValidator(); var scopes = validator.ParseScopes("openid email resource1 resource2"); var result = validator.AreScopesAllowed(_unrestrictedClient, scopes); Assert.IsTrue(result); }