Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

rest api via knox only admin can access

avatar
Contributor

Hi All:

when curl via knox i only can use admin (-u admin:admin-password) to access and can't use other account or will reply :

HTTP/1.1 401 Unauthorized Date: Fri, 13 Oct 2017 05:45:38 GMT Set-Cookie: rememberMe=deleteMe; Path=/gateway/default; Max-Age=0; Expires=Thu, 12-Oct-2017 05:45:38 GMT WWW-Authenticate: BASIC realm="application" Content-Length: 0 Server: Jetty(9.2.15.v20160210)

my command:

curl -i -k -u user1:Hadoop -X PUT 'https://knoxHost:8443/gateway/default/webhdfs/v1/user1/senfile1?op=CREATE'

folder permission:

drwxr-xr-x - user1 hdfs 0 2017-10-05 11:08 /user1

Knox users-ldif:

# entry for user1

dn: uid=user1,ou=people,dc=hadoop,dc=apache,dc=org objectclass:top objectclass:person objectclass:organizationalPerson objectclass:inetOrgPerson cn: user1 sn: user1 uid: user1 userPassword:Hadoop

Ranger (Sync Source is Unix) HDFS config: add user1 to default all-path policy

Ranger knox config: add user1 to default all-topology, service policy

if any wrong in my config?

1 ACCEPTED SOLUTION

avatar
Contributor

oh! i think i solved this problem,

after add user1, i restart knox all service, and start DEMO LDAP, and DEMO LDAP looks no restart,

so i stop DEMO LDAP then restart again, it's worked!

thanks @Aditya Sirna

View solution in original post

3 REPLIES 3

avatar
Super Guru

@Sen Ke,

Can you please attach the gateway.log (/var/log/knox/gateway.log)

avatar
Contributor

@Aditya Sirna

2017-10-16 09:40:15,499 INFO hadoop.gateway (KnoxLdapRealm.java:getUserDn(691)) - Computed userDn: uid=user1,ou=people,dc=hadoop,dc=apache,dc=org using dnTemplate for principal: user1

2017-10-16 09:40:15,509 INFO hadoop.gateway (KnoxLdapRealm.java:doGetAuthenticationInfo(203)) - Could not login: org.apache.shiro.authc.UsernamePasswordToken - user1, rememberMe=false (10.243.91.58)

2017-10-16 09:40:15,509 ERROR hadoop.gateway (KnoxLdapRealm.java:doGetAuthenticationInfo(205)) - Shiro unable to login: javax.naming.AuthenticationException: [LDAP: error code 49 - INVALID_CREDENTIALS: Bind failed: ERR_229 Cannot authenticate user uid=user1,ou=people,dc=hadoop,dc=apache,dc=org]

avatar
Contributor

oh! i think i solved this problem,

after add user1, i restart knox all service, and start DEMO LDAP, and DEMO LDAP looks no restart,

so i stop DEMO LDAP then restart again, it's worked!

thanks @Aditya Sirna