Class SokletOAuth
java.lang.Object
com.revetsec.soklet.SokletOAuth
Thin OAuth transport helpers for Soklet. Callback input remains untrusted until Revetsec core completes the
authorization transaction. These helpers select no provider and make no authentication or authorization decision.
- Since:
- 1.0.0
- Author:
- Mark Allen
-
Method Summary
Modifier and TypeMethodDescriptionParses a callback using the route's GET or POST method.Builds a 302 redirect with no-store and no-referrer headers.Builds a 302 redirect with application-owned cookies, no-store and no-referrer headers.
-
Method Details
-
authorizationResponseResultFor
public static @NonNull SokletOAuthCallbackResult authorizationResponseResultFor(@NonNull Request request) Parses a callback using the route's GET or POST method. GET supplies the unchanged raw query; POST supplies the unchanged body, raw query and every materialized Content-Type value to core's form parser. No decoded query or form map is used. Other methods, including HEAD, return Rejected before callback input is inspected, even if Soklet discarded a body. The application selects the HTTP response (for example, a route-level 405) and must not load or consume pending login state for that rejection. This parsing grants no identity and does not validate pending transaction state.Soklet 4 preserves header values as lists. Every materialized occurrence, including identical physical duplicates and differently cased names, is passed to core for ambiguity checks.
- Parameters:
request- the application-routed callback request- Returns:
- parsed, rejected or oversized callback outcome
- Throws:
NullPointerException- if request is null- Since:
- 1.0.0
-
redirect
Builds a 302 redirect with no-store and no-referrer headers. The application supplies a trusted destination; core remains responsible for selecting and validating provider endpoints used in its authorization flow.- Parameters:
location- the absolute HTTP(S) destination, without userinfo or control characters- Returns:
- the redirect response
- Throws:
IllegalArgumentException- if location is unsafe for an HTTP redirectNullPointerException- if location is null- Since:
- 1.0.0
-
redirect
public static @NonNull Response redirect(@NonNull URI location, @NonNull Set<@NonNull ResponseCookie> cookies) Builds a 302 redirect with application-owned cookies, no-store and no-referrer headers. Cookie selection and security attributes belong to the application. The destination is not derived from request headers.- Parameters:
location- the absolute HTTP(S) destination, without userinfo or control characterscookies- the application's response cookies- Returns:
- the redirect response
- Throws:
IllegalArgumentException- if location is unsafe for an HTTP redirectNullPointerException- if a required argument or cookie is null- Since:
- 1.0.0
-