All Apps and Add-ons

Handler 'passwords': could not parse name

Nicholas_Key
Splunk Employee
Splunk Employee

I kept getting this error from the storage/passwords endpoint when doing a POST with web framwork toolkit to create new creds entry into app.conf:

HTTP 400 Bad Request -- 
 In handler 'passwords': could not parse name. Use format: <username> OR <realm>:<username>

This is the sample code that I have (adapted from http://dev.splunk.com/view/SP-CAAAETW#setupform)

from splunkdj.setup import forms

class UserSetupForm(forms.Form):
    name = forms.CharField(
        label="Username", endpoint="storage/passwords",
        entity="credential", field="name", max_length=100)

    password = forms.CharField(
        label="Password", endpoint="storage/passwords",
        entity="credential", field="password", max_length=100)

I got this error when I used entity="*"

HTTP 404 Not Found -- 
 In handler 'passwords': Could not find object id=:*:

I got this error when I used entity="_new"

IllegalOperationException : Cannot update the name of an Entity via the REST API.

Help?

1 Solution

dfoster_splunk
Splunk Employee
Splunk Employee

It seems that the storage/passwords endpoint doesn't work well with framework setup screens at the moment: You can only read a password from the 'clear_password' field of a "storage/passwords" entity. However writing must be done to the 'password' field. The default setup fields are not designed for this kind of asymmetry.

Easy solution (1): Store username/password in custom conf file instead of "storage/passwords". This is covered in the setup view tutorial.

Harder solution (2): Use a custom load & save function for the fields related to "storage/passwords" that work around the strangeness of the "storage/passwords" endpoint.

View solution in original post

0 Karma

dfoster_splunk
Splunk Employee
Splunk Employee

It seems that the storage/passwords endpoint doesn't work well with framework setup screens at the moment: You can only read a password from the 'clear_password' field of a "storage/passwords" entity. However writing must be done to the 'password' field. The default setup fields are not designed for this kind of asymmetry.

Easy solution (1): Store username/password in custom conf file instead of "storage/passwords". This is covered in the setup view tutorial.

Harder solution (2): Use a custom load & save function for the fields related to "storage/passwords" that work around the strangeness of the "storage/passwords" endpoint.

0 Karma
Get Updates on the Splunk Community!

Technical Workshop Series: Splunk Data Management and SPL2 | Register here!

Hey, Splunk Community! Ready to take your data management skills to the next level? Join us for a 3-part ...

Spotting Financial Fraud in the Haystack: A Guide to Behavioral Analytics with Splunk

In today's digital financial ecosystem, security teams face an unprecedented challenge. The sheer volume of ...

Solve Problems Faster with New, Smarter AI and Integrations in Splunk Observability

Solve Problems Faster with New, Smarter AI and Integrations in Splunk Observability As businesses scale ...