mirror of
https://github.com/bolkedebruin/rdpgw.git
synced 2025-08-17 22:13:50 +02:00
Work with go-jose to have encryption
This commit is contained in:
parent
2822dc8dd1
commit
188f077da1
7 changed files with 131 additions and 55 deletions
|
@ -2,6 +2,7 @@ package common
|
|||
|
||||
import (
|
||||
"context"
|
||||
"log"
|
||||
"net"
|
||||
"net/http"
|
||||
"strings"
|
||||
|
@ -48,3 +49,12 @@ func GetClientIp(ctx context.Context) string {
|
|||
}
|
||||
return s
|
||||
}
|
||||
|
||||
func GetAccessToken(ctx context.Context) string {
|
||||
token, ok := ctx.Value("access_token").(string)
|
||||
if !ok {
|
||||
log.Printf("cannot get access token from context")
|
||||
return ""
|
||||
}
|
||||
return token
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue