Class OAuth2Parameters
java.lang.Object
com.codename1.backend.security.oauth2.core.OAuth2Parameters
The small pieces of text an OAuth2 exchange is made of: a form, a query, a
list of scopes, a random value, a PKCE challenge. Written here once because
both sides of the exchange -- the client that signs in elsewhere and the
server that issues tokens -- read and write the same ones.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Stringuriwithfieldsadded to its query.static StringThe reverse ofencode(String), with+read as a space; null whenvalueis not a well-formed encoding.static Stringvalueasapplication/x-www-form-urlencodedwrites it: every byte of its UTF-8 that is not a letter, a digit or one of-._~as%XX.static booleanequalsConstantTime(String a, String b) Whether two values are equal, in time that does not depend on where they differ.static Stringfieldsas a form body or a query, without a leading?.The fields of a form or a query, in order.static Stringrandom(int bytes) A value nobody can guess:bytesbytes from the system's generator, written in the URL-safe alphabet.The scopes of a space-separated list, in order, each once.static Stringscopes(Collection<String> scopes) scopesas one space-separated value.static StringThe SHA-256 ofvaluein the URL-safe alphabet: the S256 challenge of a PKCE verifier, and what a secret token is stored and looked up by.static Stringstring(byte[] bytes) The text ofbytes, read as UTF-8.static byte[]The bytes ofvaluein UTF-8.Every value the fieldnamehas in a form or a query, in order: for a parameter that may be sent more than once, asresourcemay.
-
Method Details
-
encode
-
decode
The reverse ofencode(String), with+read as a space; null whenvalueis not a well-formed encoding. -
parse
-
values
-
format
-
append
-
scopes
-
scopes
scopesas one space-separated value. -
random
A value nobody can guess:bytesbytes from the system's generator, written in the URL-safe alphabet. 32 bytes is 256 bits. -
sha256
-
equalsConstantTime
-
utf8
The bytes ofvaluein UTF-8. -
string
The text ofbytes, read as UTF-8.
-