papakias
papakias

Reputation: 3473

Can I set AuthenticatedUser in a MobileFirst 8 adapter?

If use the securityContext.getAuthenticatedUser(); command in a javascript adapter I get the authenticated user.

Is there a method to set the authenticated user object in order to include certain attributes (like setActiveUser in MobileFirst 7) ?

If not, how can session objects be stored? is WL.Server.getClientRequest().getSession().setAttribute still working in MobileFirst 8?

Upvotes: 0

Views: 342

Answers (1)

Nathan H
Nathan H

Reputation: 49371

In MobileFirst Foundation 8.0, only security checks can set the authenticated user.

Also, 8.0 is session-independent, so there is no getSession.

In Java adapters, you can use

@Context
AdapterSecurityContext securityContext;
securityContext.getClientRegistrationData()

To get data attached to the current client ID.

You can then use storeClientRegistrationData to update this registration data.
This registration data is meant to be for lightweight data that relates to the security.
For anything else, you are expected to use some external database or data storage. You could use the client ID as they key.

In JavaScript adapters you can also getTokenIntrospectionData. You cannot set any attributes. So you need to use an external storage.

Upvotes: 2

Related Questions