Skip to content

Commit

Permalink
📝 README: adds code verifier verification examples.
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewhartstonge committed Jan 24, 2022
1 parent 2018abb commit 2312892
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Added
- :memo: README: adds code verifier verification examples.

### Fixed
- :memo: README: fixes a couple of spelling misteaks.

Expand Down
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ func main() {
fmt.Println("my generated code verifier is:", key.CodeVerifier())
fmt.Println("my generated plain code challenge is:", key.CodeChallenge())

isValid := key.VerifyCodeVerifier("incoming-code-verifier")
// Finally - on the server-side side, we can verify the received code
// verifier:
receivedCodeVerifier := "#yolo-cant-verify-me-mr-mcbaggins"
isValid := key.VerifyCodeVerifier(receivedCodeVerifier)
fmt.Println("is the received code verifier valid?", isValid)
}
```
Expand Down Expand Up @@ -119,8 +122,11 @@ func main() {
fmt.Println("my manually generated code verifier is:", codeVerifier)
fmt.Println("my manually generated code challenge is:", codeChallenge)

// Finally - on the server-side side, we can verify the provided proof key:

// Finally - on the server-side side, we can verify the received code
// verifier:
incomingCodeVerifier := "#yolo-cant-verify-me-mr-mcbaggins"
isValid := pkce.VerifyCodeVerifier(pkce.S256, incomingCodeVerifier, codeChallenge)
fmt.Println("is the received code verifier valid?", isValid)
}

```
Expand Down

0 comments on commit 2312892

Please sign in to comment.