How to authenticate Golang Restful API?

I want to know how to authenticate Golang Restful API, but I don"t have a clue about it.

Sep.16,2021

middleware, is supported by many frameworks, and can also be natively implemented


restful can be thought of as an interface design style, but it is still a http request. The ajax interface of
website can also be designed in restful style, so directly use the same authentication method as the website, such as session.

.

if you follow the trend, you can also use token authentication methods such as jwt. If it is a pure API service for server access, you can also use a way that golang itself supports, such as basic auth.

your question is not easy to answer because you haven't made it clear what you want.


in general, token is used for authentication on all sides.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1bc9193-30934.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1bc9193-30934.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?