From e83516174502b5f1f139cc756291dbb41afd8120 Mon Sep 17 00:00:00 2001 From: Jason Parraga Date: Mon, 1 Jan 2024 21:12:36 -0600 Subject: [PATCH] Add examples to README --- README.md | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2ce4fb1..2d063ec 100644 --- a/README.md +++ b/README.md @@ -5,4 +5,27 @@ [![Go Report](https://goreportcard.com/badge/github.com/sovietaced/okta-jwt-verifier)](https://goreportcard.com/report/github.com/sovietaced/okta-jwt-verifier) Alternative implementation to the official [okta-jwt-verifier](https://github.com/okta/okta-jwt-verifier-golang) that -includes support for telemetry (ie. OpenTelemetry), minimizing operational latency, and testability. +includes support for telemetry (ie. OpenTelemetry), minimizing operational latency, and testability. + +## Examples + +### ID Token Validation + +```go +import ( + "context" + verifier "github.com/sovietaced/okta-jwt-verifier" +) + +func main() { + ctx := context.Background() + issuer := "https://test.okta.com" + clientId := "test" + v := verifier.NewVerifier(issuer, clientId) + + idToken := "..." + token, err := v.VerifyIdToken(ctx, idToken) +} + +``` +