All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.davidmoten.oa3.codegen.http.BearerAuthenticator Maven / Gradle / Ivy

The newest version!
package org.davidmoten.oa3.codegen.http;

@FunctionalInterface
public interface BearerAuthenticator extends Interceptor {

    String token();
    
    default RequestBase intercept(RequestBase r) {
        Headers h = new Headers(r.headers());
        h.put("Authorization", "Bearer " + token());
        return new RequestBase(r.method(), r.url(), h);
    }
    
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy