Build a Basic CRUD App with Angular 5.0 and Spring Boot 2.0

David Krider

Really timely and well done! Thank you very much!

David Smith

thanks for the tutorial, really good. I was wondering if you have any good CMS suggestion to use on top of this code. I mean, I create a website that let’s the administrators to manage the content, for example, create, update, and delete pages. Also, install plugins for Google Analytics, SEO, plugins to manage contact forms, etc. Something similar to Wordpress plugin system. Thanks!

Matt Raible

Hello David: we recommend using static sites instead of a CMS. This probably works best for developers, but we love using static sites on the @oktadev team.

Unfortunately, I don’t know of any CMS software that’s built with Spring Boot and Angular.

David Smith

thank you Matt. Probably in the future we have more luck about this. You are doing a good job!

Junior Osho

I am now in 2018 migrating your post to Angular 6. then put the URL in the firebase. Thank you

Naveen Lanka

The app is launching but the car list is not showing up and I am unable to add the car as as well https://uploads.disquscdn.c…

What am I missing I downloaded the master copy github

Matt Raible

Check your developer console. It’s likely a CORS error and you need to read a bit further in the tutorial for the solution.

Matt Raible

I don’t understand what you’re trying to say. Are you asking me to write this post again using Angular 6?

Naveen Lanka

Thanks I got it working

Dwayne Patel

having an issue with ._links.self.href
RROR TypeError: Cannot read property ‘self’ of undefined

Matt Raible

What version of Angular are you using? This tutorial only works with Angular 5. If you’re using v5, you might try comparing your code with the example project on GitHub: https://github.com/oktadeve…

jbye

Hello that’s don’t work in the end . The console sens me an error Tokken. I have already cheak my number tokken and it’s good… so I don’t know what to do…

jbye

https://uploads.disquscdn.c…

Matt Raible

Make sure you created an AuthInterceptor and registered it properly. Then use the network tab to ensure an Authorization header is being sent.

Veda Gangatkar

Hi,
Is there a way to differentiate between type of users logging in to a website. For instance, Admin should be able to access everything whereas user should be able to access certain pages only. As OKta manages all user login , how can I get to know whether admin / user login ?

Matt Raible

You can add your users to groups, then include the groups as a claim in the ID or access token. Then you can get the information you need from the token. For the Angular SDK, there’s an open issue for adding a directive to show/hide based on group/role.

To add groups as a claim, navigate to API > Authorization Servers, click the Authorization Servers tab and edit the default one. Click the Claims tab and Add Claim. Name it “groups”, and include it in the ID Token. Set the value type to “Groups” and set the filter to be a Regex of .* (dot asterisk with no space between).

Veda Gangatkar

Thanks Matt for the reply. I created a group and added a new user to the group and also followed the steps as you mentioned to add groups as a claim. Now how do I differentiate between admin/ user login ? In my angular app I need to route the user login to a different path and admin to a different path. So which method gives me role information?

Matt Raible

You can use oktaAuth.getUser() in the Okta Angular SDK to get user information. You’ll need to implement additional logic base on that information yourself. If you figure out a good solution, please let us know. If you really like it, we can consider adding it to our SDK. We also accept pull requests! :wink:

Veda Gangatkar

Sure Matt.
And I am running into an issue "Invalid access token " when I try to access the back end REST call(401 status code)
POST-MAN:
{
“error”: “invalid_token”,
“error_description”: “eyJraWQiOiJMRGZydHJiaGFMaGE4UURVUkZMOW12clVDRlBsSUhYVGYyV0RHSzltMk1ZIiwiYWxnIjoiUlMyNTYifQ.eyJ2ZXIiOjEsImp0aSI6IkFULk05TTJ5b0c2QUlZVUt2emNRMHZyNUZwX01ZX25TbjVYUUwwNXBYQWUtZTgiLCJpc3MiOiJodHRwczovL2Rldi0yMzU3MTYub2t0YXByZXZpZXcuY29tL29hdXRoMi9kZWZhdWx0IiwiYXVkIjoiYXBpOi8vZGVmYXVsdCIsImlhdCI6MTUzNDc3MTM5MCwiZXhwIjoxNTM0Nzc0OTkwLCJjaWQiOiIwb2FmeWJjOGo0RktZTVk2dTBoNyIsInVpZCI6IjAwdWZ5NWN3bGdYa0dJbWVLMGg3Iiwic2NwIjpbIm9wZW5pZCIsImVtYWlsIl0sInN1YiI6InZlZGFyc2guZ2FuZ2F0a2FyQGdtYWlsLmNvbSJ9.PxuYncxoDbjXSL80lfCJMRqCLDYsJjtCPX1YZyBD9UQzyaxEGSs9GK7V5tdgEMuZ93UxKOLojvXRCv4Vn_erAEeLpULa78v0Sgg1xbbf_A3Oo3wAwyExXX_BA6ztikewgOdi2Kc01oIo7OTwAp7vV9Yar-JDRrwKjmzE85MQKdk_r-n1VT-mOm8FpQmaoadKrcZDBjnKg5aO0OzY1fgQfoy6o7iyfFhkkkq-jmdko_f3sj42wnvZETJOf5zpMhxaCjedrxtAFRUzu8c4PlyrmNdzN0S6_-HTPc49cgZMIMD54Ey0NgDqEfszdsrCQzOM_ESs1TWAV5ox4bg6H0SAOQ”
}

https://uploads.disquscdn.c…

Spring boot error:
Could not fetch user details: class org.springframework.web.client.ResourceAccessException, I/O error on GET request for “https://dev-235716.oktaprev…”: Connection reset; nested exception is java.net.SocketException: Connection reset.
And also I am unable to access the url :“https://dev-235716.oktaprev…
https://uploads.disquscdn.c…

Can you please let me know whats going wrong?

Veda Gangatkar

I am also facing the same issue. Proper authorization Header is been sent but still no luck.