books-api icon indicating copy to clipboard operation
books-api copied to clipboard

Add Spring Security

Open knjk04 opened this issue 3 years ago • 9 comments

Add Spring security with roles ('user' and 'admin').

All queries should be accessible without being authenticated. Mutations should only be allowed for those with admin access.

knjk04 avatar Mar 01 '21 10:03 knjk04

Hey, I would like to try adding user/admin roles. Can I?

pranatimittal avatar Oct 02 '21 16:10 pranatimittal

Hi @pranatimittal, sure, I'll assign you to the issue. Thanks!

knjk04 avatar Oct 02 '21 16:10 knjk04

@knjk04 could you help me get started? I have never worked with dgs and spring security and interested to lean it

pranatimittal avatar Oct 03 '21 15:10 pranatimittal

Hey, @knjk04 How user should be authorized? Basic Auth? Bearer Token? Oauth? Maybe API Key?

machinalny avatar Oct 04 '21 16:10 machinalny

@pranatimittal For both DGS and Spring Security, but particularly DGS, I recommend looking at the official documentation. DGS is quite new, so there may be relatively few tutorials out there. They have a page on Spring security. You can also walk through the tutorials on the site to find out how it works.

For Spring Security specifically, there are lots of good tutorials online, so you can find what works best for you.

I've noticed that security comes under the advanced section in the DGS documentation, so I've removed the 'good first issue' label.

If you don't mind, I'll unassign you from this issue as it may be trickier for a beginner (although, definitely doable) than I initially thought. I'll see if there's something else for you to pick it up. It looks like @machinalny has some experience with this, so I think they'll be a better fit for this.

knjk04 avatar Oct 10 '21 06:10 knjk04

Hi @machinalny, good question! API key would be great. Are you happy for me to assign you to this?

knjk04 avatar Oct 10 '21 06:10 knjk04

Hi @knjk04, thanks! You can assign it to me, ;)

machinalny avatar Oct 12 '21 18:10 machinalny

@machinalny How are you getting on with this?

knjk04 avatar Dec 15 '21 17:12 knjk04

@machinalny Unassigning due to no response

knjk04 avatar Feb 05 '22 19:02 knjk04