Turn on Anonymous access

I currently have version 8.9.1 of Kibana (basic license) installed on my machine. I created an anonymous user with full access to testing

I've added the following to Elasticsearch.yml

xpack.security.authc:
  anonymous:
    username: anonymous_user 
    roles: admin
    authz_exception: true

And I added the following to kibana.yml

xpack.security.authc.providers:
  basic.basic1:
    order: 0
  anonymous.anonymous1:
    order: 1
    credentials:
      username: "anonymous_service_account"
      password: "anonymous_service_account_password"

When I click on the anonymous login option on the login screen, I get the following error

Error: [security_exception
	Root causes:
		security_exception: unable to authenticate user [anonymous_user1] for REST request [/_security/_authenticate]]: unable to authenticate user [anonymous_user1] for REST request [/_security/_authenticate]
    at login_form_LoginForm.loginWithSelector (http://localhost:5601/64802/bundles/plugin/security/1.0.0/security.chunk.7.js:3:14315)

Hi @gabrielpicagevicz,

Welcome to the community! Can you confirm the user and password is setup in Kibana and that those credentials match those in your kibana.yml?

Hello Carly Richmond,

Thank you for the response. The previous issue has been completely resolved by creating a user in Kibana. However, I have a new question.

I have created a dashboard with a heat map and populated it with some data. I need to implement this dashboard in an external application through an iframe (I was able to create an iframe by sharing the dashboard). However, when I add the iframe to the HTML, it keeps loading infinitely.

HTML embedding the dashboard:

<!DOCTYPE html>
<html>
<head>
    <title> Kibana</title>
</head>
<body>
    <iframe src="http://localhost:5601/app/dashboards?auth_provider_hint=anonymous1#/view/28f244b0-5a55-11ee-9d0f-2df0c1692a5f?_g=()&_a=(panels:!((embeddableConfig:(enhancements:(),hiddenLayers:!(),isLayerTOCOpen:!t,mapBuffer:(maxLat:-23.56399,maxLon:-46.4502,minLat:-23.68477,minLon:-46.62598),mapCenter:(lat:-23.62215,lon:-46.54096,zoom:12.43),openTOCDetails:!('4c320114-8722-40fe-accb-2f2e2d21601f')),gridData:(h:20,i:f3ac19b8-0dba-4aaa-889f-8945c476e13c,w:29,x:0,y:0),id:'9781f710-5a4e-11ee-9d0f-2df0c1692a5f',panelIndex:f3ac19b8-0dba-4aaa-889f-8945c476e13c,type:map,version:'8.9.1'))" width="800" height="600"></iframe>
</body>
</html>

When I run it, the following screen remains stuck infinitely:

In my Kibana.bat console, the same message keeps incrementing:

[2023-09-30T19:38:16.534-03:00][INFO ][plugins.security.routes] Logging in with provider "anonymous1" (anonymous)

Can you try to add the xpack.security.sameSiteCookies and xpack.security.secureCookies options as per this thread? Let us know if this resolves your loop issue.

Hi, I added both lines as requested; however, the issue persisted...

Out of curiosity, I changed my address from 127.0.0.1:5500/index.html to localhost:5500/index.html, and guess what? The problem was resolved...

I appreciate your help!!!

I am working on my college thesis, and your support in these situations has been extremely valuable!

Thank you, Carly

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.