[keycloak-user] keycloak with angular/restfull

Stian Thorgersen stian at redhat.com
Tue Jun 2 02:59:30 EDT 2015

----- Original Message -----
> From: "Juan Diego" <juandiego83 at gmail.com>
> To: keycloak-user at lists.jboss.org
> Sent: Tuesday, 2 June, 2015 1:56:10 AM
> Subject: [keycloak-user] keycloak with angular/restfull
> Hi
> I am doing an app with angularjs with keycloak. There a few things that I
> dont know how to do it, I have being seing the videos and reading
> documentation so I have 2 questions.
> Regarding the model of the database, how am I supposed to link Users to
> Tables. How do you recommend to work on the model, I am kind of cluless
> there.
> For example before I had a table User and a Table Pictures. Now my users are
> in the KeyCloak database, how are you supposed to handle tables that would
> have been linked to a user.

Depending on your use-case I'd recommend storing the details you need about users in your apps database as well. You can do this when the user logs in and sync the profile from the token into your users table and link it with the user id. 

> My second question is about my front and backend. I am just allowing my users
> to upload pictures it is a small app. I am doing the front end with
> AngularJS so it is basically html+javascript, and the backend handles the
> services. Should I create a client in my KeyCloak for the frontend and
> another for the backend. It seems to my that I should create a client only
> for the backend , and the front end needs to validate against that.

Both - angularjs app needs a public client and is the one that drives the login (by using keycloak.js). The backend should be a bearer-only client and only verifies the tokens.

> Thanks
> Juan Diego Calle
> _______________________________________________
> keycloak-user mailing list
> keycloak-user at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/keycloak-user

More information about the keycloak-user mailing list