Micah
Micah

Reputation: 116050

Need help trying to understand the OAuth2 Spec

The bearer token spec is the one I have a question about. I'm trying to figure out what characters are allowed in the token when placed in the Authorization: OAuth ...... header. Here's what the spec says

credentials = "OAuth2" RWS access-token [ RWS 1#auth-param ]
access-token = 1*( quoted-char / <"> )

quoted-char = "!" / "#" / "$" / "%" / "&" / "'" / "(" / ")" / "*" / "+" / "-" / "." / "/" / DIGIT / ":" / "<" / "=" / ">" / "?" / "@" / ALPHA / "[" / "]" / "^" / "_" / "`" / "{" / "|" / "}" / "~" / "" / "," / ";"

I'm not sure how to read this. I'm new at reading RFC's so if someone could explain it I would appreciate it.

Upvotes: 2

Views: 211

Answers (2)

nov matake
nov matake

Reputation: 958

You can simply use Base64 encode.

It doesn't use some of characters (ex. "!", "#"..) in the BNF though.

If you want to know all allowed characters,

"!" / "#" / "$" / "%" means all these characters ("!", "#", "$", "%") are allowed.

Upvotes: 0

heavi5ide
heavi5ide

Reputation: 1609

It looks like it's augmented BNF from the HTTP/1.1 spec (RFC2616):

http://www.rfc2616.com/#2.1

Upvotes: 1

Related Questions