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
Post a Comment