Example #1
0
        public async Task GetApplicationRolesForCompositeForRealmAsync(string realm, string clientId)
        {
            var clients = await ClientsClient.GetClientsAsync(realm);

            string clientsId = clients.FirstOrDefault(x => x.ClientId == clientId)?.Id;

            if (clientsId != null)
            {
                var roles = await RolesClient.GetRolesAsync(realm);

                string roleName = roles.FirstOrDefault()?.Name;
                if (roleName != null)
                {
                    var result = await RolesClient.GetApplicationRolesForCompositeAsync(realm, roleName, clientsId);

                    Assert.NotNull(result);
                }
            }
        }
Example #2
0
        public async Task GetUsersWithRoleNameForClientAsync(string realm, string clientId)
        {
            var clients = await ClientsClient.GetClientsAsync(realm);

            string clientsId = clients.FirstOrDefault(x => x.ClientId == clientId)?.Id;

            if (clientsId != null)
            {
                var roles = await RolesClient.GetRolesAsync(realm, clientsId);

                string roleName = roles.FirstOrDefault()?.Name;
                if (roleName != null)
                {
                    var result = await RolesClient.GetUsersWithRoleNameAsync(realm, clientsId, roleName);

                    Assert.NotNull(result);
                }
            }
        }
Example #3
0
        public async Task GetRoleAuthorizationPermissionsInitializedForClientAsync(string realm, string clientId)
        {
            var clients = await ClientsClient.GetClientsAsync(realm);

            string clientsId = clients.FirstOrDefault(x => x.ClientId == clientId)?.Id;

            if (clientsId != null)
            {
                var roles = await RolesClient.GetRolesAsync(realm, clientsId);

                string roleName = roles.FirstOrDefault()?.Name;
                if (roleName != null)
                {
                    var result = await RolesClient.GetRoleAuthorizationPermissionsInitializedAsync(realm, clientsId, roleName);

                    Assert.NotNull(result);
                }
            }
        }
Example #4
0
        public async Task GetRolesForRealmAsync(string realm)
        {
            var result = await RolesClient.GetRolesAsync(realm);

            Assert.NotNull(result);
        }