jaas

Jaas - Requesting Renewable Kerberos Tickets

我与影子孤独终老i 提交于 2019-11-30 20:27:50
问题 I have a Java API that talks to the Kerberos server and performs various operations. As of now, my API requests for non-renewable tickets to the Kerberos server. From what I understand, the jaas config file has an option to set the renewTGT option to true so that a renewable ticket can be issued. However, Jaas seems to have a lot of restrictions on setting the "renewUntil" time. Can anyone please tell me how we can request for arenewable ticket and also control its renewability? Basically, is

Kafka Java Producer with kerberos

有些话、适合烂在心里 提交于 2019-11-30 19:11:52
问题 Getting error while sending message to kafka topic in kerberosed enviornment. We have cluster on hdp 2.3 I followed this http://henning.kropponline.de/2016/02/21/secure-kafka-java-producer-with-kerberos/ But for sending messages, I have to do kinit explicitly first, then only I am able to send message to kafka topic. I tried to do knit through java class but that also doesn't work. PFB code: package com.ct.test.kafka; import java.util.Date; import java.util.Properties; import java.util.Random

EJB3 & How JAAS subject/principal is propagated to EJB Tier from servlet container?

北城以北 提交于 2019-11-30 15:55:16
I'm trying to understand how the JAAS principal propagates to the Business/EJB tier from web tier. I've read that the if the roles/realm is configured in login-config & security-context of web.xml then the servlet container will also transparently pass the authenticated principal to the EJB Tier. Two questions 1.) First & more importantly is that true ? Without any intervention from the developer ! 2.) And secondly any idea how that works under the hood. yes it's true. that's generally the point of ejb, to take the "hard" stuff out of the hands of the developer (e.g. security, transactions,

Wildfly caches roles after logout in a web application

谁都会走 提交于 2019-11-30 14:13:49
jboss-web.xml <?xml version="1.0" encoding="UTF-8"?> <jboss-web> <security-domain flushOnSessionInvalidation="true">my-aktion </security-domain> <valve> <class-name>utils.MyAuthenticator</class-name> </valve> </jboss-web> standalone.xml <security-domain name="my-aktion" cache-type="default"> <authentication> <login-module code="utils.MyAuthenticator" flag="required"> <module-option name="dsJndiName" value="java:jboss/datasources/MySQLDS"/> <module-option name="principalsQuery" value="SELECT password FROM user WHERE username=?"/> <module-option name="rolesQuery" value="SELECT r.role, 'Roles'

Using Mockito, how do I intercept a callback object on a void method?

空扰寡人 提交于 2019-11-30 04:27:34
I'm using mockito to test a legacy JAAS/LDAP login module. The javax.security.auth.callback.CallbackHandler interface defines the function: void handle(javax.security.auth.callback.Callback[] callbacks) I'm expecting callbacks to contain a NameCallback , which is the object that needs to be manipulated to pass the test. Is there a way to mock this effectively, or would I be better off with a stubbed implementation of CallbackHandler ? For functions returning void , use doAnswer() doAnswer(...).when(mockedObject).handle(any(Callback[].class)); And an Answer that performs the interception must

Kafka “Login module not specified in JAAS config”

我与影子孤独终老i 提交于 2019-11-30 02:54:41
问题 I have a problem communicating with Kafka secured with sasl using console scripts. Kafka is secured with sasl , listener is SASL_PLAINTEXT and mechanism is PLAIN . What I did: I tried listing some data using one of kafka scripts: bin/kafka-consumer-groups.sh --bootstrap-server (address) --list However I get WARN Bootstrap broker (address) disconnected (org.apache.kafka.clients.NetworkClient) and command fails, which is understandable because it's secured with sasl. So I tried how to add

Why do I list security roles in web.xml when they're in jdbcRealm database?

南楼画角 提交于 2019-11-29 19:47:59
问题 I run JavaEE 6 web application on Glassfish 3. I use JAAS with jdbcRealm and default principal to role mapping. In my database I have table for mapping usernames to their roles: username | role ----------+------- john | admin mary | user Why do I need to list these roles once again in my web.xml ? <security-role> <role-name>admin</role-name> </security-role> <security-role> <role-name>user</role-name> </security-role> Without that isUserInRole() always returns false . 回答1: You don't redefine

ActiveMQ authorization

自闭症网瘾萝莉.ら 提交于 2019-11-29 15:16:23
问题 If I want to implement JAAS authorization on Apache ActiveMQ, do I have to use the plug-in in the activemq.xml configuration file? This way is really NOT good because if I want to change authorization, I have to change the activemq.xml file and restart the server in order to work. Is there any way I can use like JAAS authentication by changing other properties file rather than the activemq.xml file? Or can I custom my own authorization plugin? Thanks. 回答1: Whenever I have set up ActiveMQ

Using JaaS with Jersey on Grizzly

末鹿安然 提交于 2019-11-29 12:23:42
I'm trying to find a simple, flexible way to add JaaS authentication to REST. I found a post that I think leads me in the right direction (See StevenC's answer). It sounds like the servlet container is responsible for security, not the Jersey code itself. I like this idea, but need a little guidance on implementation. Grizzly is my servlet container and I want to configure it to use JaaS for authentication. For now, a simple username/password combination would be fine, and hard-coding the username/password pairs directly in code is fine. As long as it uses JaaS, we can refine those details

Can Kafka be provided with custom LoginModule to support LDAP?

北战南征 提交于 2019-11-29 11:16:12
Kafka can be configured to use several authentication mechanisms: plaintext username/password, Kerberos or SSL. The first 2 use SASL, where there is a JAAS config file required. For the plain text auth method, the config looks like (taken from the documentation ): KafkaServer { org.apache.kafka.common.security.plain.PlainLoginModule required username="admin" password="admin-secret" user_admin="admin-secret" user_alice="alice-secret"; }; I want to authenticate if possible using LDAP. My question is this: if I replace the PlainLoginModule with a class that implements LoginModule and place this