cancel
Showing results for 
Search instead for 
Did you mean: 

Can CAP Mock Auth configuration contain SAML Attributes?

former_member748
Participant
0 Kudos
309

Hello,

I have a local configuration for a CAP project which is using Mock Authentication:

"auth": {
    "strategy": "mock",
    "users": {
        "gigel": { 
            "password": "developer", 
            "roles": ["authenticated-user"]
            }
    }
}

I need to implement an endpoint which exposes the First Name and Family Name of a user.

I was looking for a way to implement it and update my mock auth configuration in such a way that both in development and in the deployed app which uses JWT auth the same implementation works.

I tried to use:

"auth": {
    "strategy": "mock",
    "users": {
        "mock": { 
            "password": "developer", 
            "roles": ["authenticated-user"],
            "userAttributes": {
                "firstName": "Mock",
                "familyName": "Developer"
            }
        }
    }
}

But I don't see the attributes in req.user.

Is it possible to configure Mock Auth for this use case? What is the recommended way for this?

Kind regards,

Stefania

Accepted Solutions (0)

Answers (0)