All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.stormpath.sdk.provider.social.UserInfoMappingRule Maven / Gradle / Ivy

Go to download

The Stormpath Java SDK API .jar provides a Java API that your code can use to make calls to the Stormpath API. This .jar is the only compile-time dependency within the Stormpath SDK project that your code should depend on. Implementations of this API (implementation .jars) should be runtime dependencies only.

The newest version!
package com.stormpath.sdk.provider.social;

import com.stormpath.sdk.provider.MappingRule;

/**
 * A rule that indicates how a userInfo attribute from a Social Provider should populate one or more Stormpath Account field values.  By
 * creating rules, you configure which userInfo attribute values from the Social Provider should be copied to Stormpath Account field values.
 * 

{@code UserInfoMappingRule}s are immutable. If you want to change the mapping rules for Accounts in a * particular Social Directory, you must remove and add new {@code UserInfoMappingRule} instances to the * Directory Provider's {@link UserInfoMappingRules} instance. * *

How does it work?

*

Each {@code UserInfoMappingRule} has a {@code name} and a collection of Stormpath account * {@link #getAccountAttributes() attribute names}.

*

When a userInfo attribute from a Social Provider is encountered, every userInfo attribute from the Social Provider * with a matching name will have its value copied to the corresponding specified Stormpath account fields.

* *
Example
*

For example, assume that a mapping rule's {@code name} is {@code foo}, and the rule's * {@link #getAccountAttributes() accountAttributes} collection contains the Stormpath Account field names * of {@code givenName} and {@code surname}.

*

If a userInfo attribute named {@code foo} is encountered on login to have a value of {@code bar}, then * {@code bar} will automatically be copied to the specified Stormpath Account fields for that user. This user would * then automatically have a {@code givenName} of {@code bar} and a {@code surname} of {@code bar}.

* * @since 1.3.0 */ public interface UserInfoMappingRule extends MappingRule { }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy