Fix section "HTTP basic and digest authentication" in 14.4.md
This commit is contained in:
@@ -10,12 +10,11 @@ Beego does not natively provide support for any of these three things, however y
|
||||
|
||||
## HTTP basic and digest authentication
|
||||
|
||||
These two certifications are some applications using relatively simple authentication, there are already open source third-party library supports both authentication:
|
||||
Both HTTP basic and digest authentication are relatively simple techniques commonly used by web applications. There are already many open source third-party libraries which support these two authentication methods, such as:
|
||||
|
||||
github.com/abbot/go-http-auth
|
||||
|
||||
The following code demonstrates how to use this library in order to achieve the introduction of beego Certification:
|
||||
|
||||
The following code demonstrates how to use this library to implement authentication in a Beego application:
|
||||
|
||||
package controllers
|
||||
|
||||
@@ -49,7 +48,7 @@ The following code demonstrates how to use this library in order to achieve the
|
||||
this.TplNames = "index.tpl"
|
||||
}
|
||||
|
||||
The above code takes advantage of beego the prepare function in the normal logic function is called before the certification, so it is very simple to achieve a http auth, digest authentication is the same principle.
|
||||
The above code takes advantage of Beego's `prepare()` function to perform authentication before allowing the normal flow of execution to proceed; as you can see, it's very simple to implement HTTP authentication. Digest authentication can be implemented in much the same way.
|
||||
|
||||
## OAuth and OAuth 2 certification
|
||||
|
||||
|
||||
Reference in New Issue
Block a user