title: Keycloak in C# WPF Application: How can I access the roles of a given user/password in C# in a normal MVVM WPF application?
body: <p>I am looking for a working implementation of a Keycloak Client in C#. Both projects on github from <a href="https://github.com/dylanplecki/KeycloakOwinAuthentication/wiki" rel="nofollow noreferrer">DylanPlecki</a> and <a href="https://github.com/mattmorg55/Owin.Security.Keycloak" rel="nofollow noreferrer">MattMorg</a> (later) did not work for me and are most probably not longer maintained.</p>
  <p>My task is to get all roles of a given user to implement a more refined db access on our data base server. So actually I am keycloak not as an Authentication server in the first place, but more to get information of the user. In our company we are in the beginning of consequently using OAUTh2.0 ;-).</p>
  <p>So here is my question: Does anyone know, how to access a keycloak server most efficiently to protect the security of the app and get the roles? Maybe via RestAPI somehow, or OIDC Protocol?</p>