java - Should I Allow access to public API without token or with token -


i using spring security , use token authenticate , authorize user once authenticated. there apis used our website visitor well.

should allow visitor access these apis providing public token (this public token accessed hitting particular url)

or

should allow visitor access apis without token?

what best approach?

if u trying provide public key(or token) access non secure api useless. try exclude them spring security.

http.authorizerequests().antmatchers("/publicapis/*").permitall() 

if u more concerned security attacks man in middle u might want consider securing public apis api signing mechanisms (hash/digest) based mechanisms create signatures request. avoid request tampering.


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -