Search in sources :

Example 1 with KerberosAuthenticationFilter

use of org.apache.cxf.jaxrs.security.KerberosAuthenticationFilter in project cxf by apache.

the class BookKerberosServer method run.

protected void run() {
    JAXRSServerFactoryBean sf = new JAXRSServerFactoryBean();
    sf.setResourceClasses(BookStore.class);
    // default lifecycle is per-request, change it to singleton
    sf.setResourceProvider(BookStore.class, new SingletonResourceProvider(new BookStoreImpl()));
    KerberosAuthenticationFilter filter = new KerberosAuthenticationFilter();
    filter.setLoginContextName("bob");
    filter.setCallbackHandler(getCallbackHandler("bob", "bob"));
    // filter.setLoginContextName("KerberosServerKeyTab");
    // filter.setServicePrincipalName("HTTP/ktab");
    sf.setProvider(filter);
    sf.setAddress("http://localhost:" + PORT + "/");
    sf.create();
}
Also used : KerberosAuthenticationFilter(org.apache.cxf.jaxrs.security.KerberosAuthenticationFilter) JAXRSServerFactoryBean(org.apache.cxf.jaxrs.JAXRSServerFactoryBean) SingletonResourceProvider(org.apache.cxf.jaxrs.lifecycle.SingletonResourceProvider)

Aggregations

JAXRSServerFactoryBean (org.apache.cxf.jaxrs.JAXRSServerFactoryBean)1 SingletonResourceProvider (org.apache.cxf.jaxrs.lifecycle.SingletonResourceProvider)1 KerberosAuthenticationFilter (org.apache.cxf.jaxrs.security.KerberosAuthenticationFilter)1