public final class HttpAuthServiceBuilder extends Object
HttpAuthService.| Constructor and Description |
|---|
HttpAuthServiceBuilder() |
public HttpAuthServiceBuilder add(Authorizer<HttpRequest> authorizer)
Authorizer.public HttpAuthServiceBuilder add(Iterable<? extends Authorizer<HttpRequest>> authorizers)
Authorizers.public HttpAuthServiceBuilder addBasicAuth(Authorizer<? super BasicToken> authorizer)
Authorizer.public HttpAuthServiceBuilder addBasicAuth(Authorizer<? super BasicToken> authorizer, CharSequence header)
Authorizer for the given header.public HttpAuthServiceBuilder addOAuth1a(Authorizer<? super OAuth1aToken> authorizer)
Authorizer.public HttpAuthServiceBuilder addOAuth1a(Authorizer<? super OAuth1aToken> authorizer, CharSequence header)
Authorizer for the given header.public HttpAuthServiceBuilder addOAuth2(Authorizer<? super OAuth2Token> authorizer)
Authorizer.public HttpAuthServiceBuilder addOAuth2(Authorizer<? super OAuth2Token> authorizer, CharSequence header)
Authorizer for the given header.public <T> HttpAuthServiceBuilder addTokenAuthorizer(Function<? super RequestHeaders,T> tokenExtractor, Authorizer<? super T> authorizer)
Authorizer.public HttpAuthServiceBuilder onSuccess(AuthSuccessHandler<HttpRequest,HttpResponse> successHandler)
AuthSuccessHandler which handles successfully authorized requests.
By default, the request will be delegated to the next HttpService.public HttpAuthServiceBuilder onFailure(AuthFailureHandler<HttpRequest,HttpResponse> failureHandler)
AuthFailureHandler which handles the requests with failed authorization.
By default, an exception thrown during authorization is logged at WARN level (if any) and a
401 Unauthorized response will be sent.public HttpAuthService build(HttpService delegate)
HttpAuthService based on the Authorizers added to this builder.public Function<? super HttpService,HttpAuthService> newDecorator()
HttpService with a new
HttpAuthService based on the Authorizers added to this builder.Copyright © 2020 LeanCloud. All rights reserved.