Package org.keycloak.servlet

Examples of org.keycloak.servlet.ServletOAuthClient


        // The ServletOAuthClient is obtained by getting a context attribute
        // that is set in the Bootstrap context listener in this project.
        // You really should come up with a better way to initialize
        // and obtain the ServletOAuthClient.  I actually suggest downloading the ServletOAuthClient code
        // and take a look how it works. You can also take a look at third-party-cdi example
        ServletOAuthClient oAuthClient = (ServletOAuthClient) request.getServletContext().getAttribute(ServletOAuthClient.class.getName());
        try {
            oAuthClient.redirectRelative("pull_data.jsp", request, response);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
View Full Code Here


        // The ServletOAuthClient is obtained by getting a context attribute
        // that is set in the Bootstrap context listener in this project.
        // You really should come up with a better way to initialize
        // and obtain the ServletOAuthClient.  I actually suggest downloading the ServletOAuthClient code
        // and take a look how it works. You can also take a look at third-party-cdi example
        ServletOAuthClient oAuthClient = (ServletOAuthClient) request.getServletContext().getAttribute(ServletOAuthClient.class.getName());
        try {
            return oAuthClient.getBearerToken(request);
        } catch (IOException e) {
            throw new RuntimeException(e);
        } catch (ServerRequest.HttpFailure failure) {
            throw new RuntimeException(failure);
        }
View Full Code Here

        // The ServletOAuthClient is obtained by getting a context attribute
        // that is set in the Bootstrap context listener in this project.
        // You really should come up with a better way to initialize
        // and obtain the ServletOAuthClient.  I actually suggest downloading the ServletOAuthClient code
        // and take a look how it works. You can also take a look at third-party-cdi example
        ServletOAuthClient oAuthClient = (ServletOAuthClient) request.getServletContext().getAttribute(ServletOAuthClient.class.getName());
        HttpClient client = oAuthClient.getClient();

        HttpGet get = new HttpGet(getBaseUrl(oAuthClient, request) + "/database/products");
        get.addHeader("Authorization", "Bearer " + accessToken);
        try {
            HttpResponse response = client.execute(get);
View Full Code Here

    private ServletOAuthClient client;

    @Override
    public void contextInitialized(ServletContextEvent sce) {
        client = new ServletOAuthClient();
        ServletContext context = sce.getServletContext();

        configureClient(context);

        client.start();
View Full Code Here

    }

    @Produces
    @ApplicationScoped
    public ServletOAuthClient produceOAuthClient() {
        return new ServletOAuthClient();
    }
View Full Code Here

TOP

Related Classes of org.keycloak.servlet.ServletOAuthClient

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.