mirror of
https://github.com/passbolt/go-passbolt.git
synced 2025-05-10 01:48:22 +00:00
Update README for MFA and Server Verification
This commit is contained in:
parent
6eb5734169
commit
0e7cca97a2
1 changed files with 24 additions and 0 deletions
24
README.md
24
README.md
|
@ -305,6 +305,30 @@ rClient, err := api.NewClient(nil, "", "https://localhost", "", "")
|
||||||
privkey, err := SetupAccount(ctx, rClient, userID, token, "password123")
|
privkey, err := SetupAccount(ctx, rClient, userID, token, "password123")
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Verification
|
||||||
|
|
||||||
|
You can Verify that the Server hasen't changed, for that you need to initially setup the Verification and save the returned values. Then you can Verify that the serverkey hasen't changed since you setup the Verification.
|
||||||
|
|
||||||
|
```go
|
||||||
|
// Setup the Verification
|
||||||
|
token, encToken, err := client.SetupServerVerification(ctx)
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
// You Need to save these
|
||||||
|
fmt.Println("Token: ", token)
|
||||||
|
fmt.Println("enc Token: ", encToken)
|
||||||
|
// Now you can Verify the Server
|
||||||
|
err = client.VerifyServer(ctx, token, encToken)
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## MFA
|
||||||
|
|
||||||
|
go-passbolt now supports MFA! You can set it up using the Client's `MFACallback` function, it will provide everything you need to complete any MFA challanges. When your done you just need to return the new MFA Cookie (usually called passbolt_mfa). The helper package has a example implementation for a noninteractive TOTP Setup under helper/mfa.go in the function `AddMFACallbackTOTP`.
|
||||||
|
|
||||||
## Other
|
## Other
|
||||||
|
|
||||||
These examples are just the main use cases of these Modules, many more API calls are supported. Look at the [reference](https://pkg.go.dev/github.com/speatzle/go-passbolt) for more information.
|
These examples are just the main use cases of these Modules, many more API calls are supported. Look at the [reference](https://pkg.go.dev/github.com/speatzle/go-passbolt) for more information.
|
||||||
|
|
Loading…
Add table
Reference in a new issue