2017-03-16 22 views
1

Apache NiFi-1.1.1のLDAP認証を有効にしました。NiFi rest apiにクレデンシャルを渡す方法

ldapユーザーでログインした後、NiFi Web UIにアクセスできます。

私は基本認証/process-groups/rootとREST APIにアクセスしようとすると、それはNiFi REST APIに資格を渡す方法

Unable to perform the desired action due to insufficient permissions. Contact the system administrator.

を示して? NiFi REST APIにトークンでアクセスする方法は?

ありがとうございます。

答えて

4

LDAP経由で認証する場合、NiFi REST APIはクライアントが各リクエストでトークンに沿って通過することを要求します。トークンを取得するには、認証するために認証情報を渡す必要があります。

curl 'https://localhost:8443/nifi-api/access/token' -H 'Accept-Encoding: gzip, deflate, br' -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' -H 'Accept: */*' --data 'username=<user>&password=<pass>' --compressed 

このリクエストは、各後続リクエストのヘッダーに渡す必要があるトークンを返します。例えば:

curl 'https://localhost:8443/nifi-api/flow/current-user' -H 'Accept-Encoding: gzip, deflate, sdch, br' -H 'Authorization: Bearer <token>' -H 'Accept: application/json, text/javascript, */*; q=0.01' --compressed 
関連する問題