Exemplo n.º 1
0
        private void gOAuthScopes_Bind(object sender, EventArgs e)
        {
            ScopeService scopeService = new ScopeService(OAuthContext);

            gOAuthScopes.DataSource = scopeService.Queryable().ToList();
            gOAuthScopes.DataBind();
        }
Exemplo n.º 2
0
        protected void gOAuthClients_RowSelected(object sender, Rock.Web.UI.Controls.RowEventArgs e)
        {
            ClientService clientService = new ClientService(OAuthContext);
            Client        client        = clientService.Get(e.RowKeyId);

            hfClientId.Value   = client.Id.ToString();
            tbClientName.Text  = client.ClientName;
            tbApiKey.Text      = client.ApiKey.ToString();
            tbApiSecret.Text   = client.ApiSecret.ToString();
            tbCallbackUrl.Text = client.CallbackUrl;
            cbActive.Checked   = client.Active;


            ClientScopeService clientScopeService = new ClientScopeService(OAuthContext);

            ScopeService scopeService = new ScopeService(OAuthContext);

            cblClientScopes.DataSource = scopeService.Queryable().Select(s => new { Id = s.Id, Value = s.Identifier + " - " + s.Description }).ToList();
            cblClientScopes.DataBind();

            clientScopeService.Queryable().Where(cs => cs.ClientId == client.Id).ToList().ForEach(cs =>
                                                                                                  cblClientScopes.Items.FindByValue(cs.ScopeId.ToString()).Selected = cs.Active
                                                                                                  );
            gOAuthClientEdit.Show();
        }