User registration in external identity provider#
In the form where you enter login and password to authenticate through an external identity provider, you may see a link to the external provider registration page (No account? Register). In order for the link not to be displayed, the refine
and matchByLogin
functions in the bind procedure must be called without specifying registration parameters.
refine(cxt, users)
instead ofrefine(cxt, users, regAttrs)
;matchByLogin(cxt)
instead ofmatchByLogin(cxt, regAttrs)
.
Here’s an example of how to use those functions in a procedure:
package com.identityblitz.idp.federation.matching.dynamic;
import java.lang.*;
import java.util.*;
import java.text.*;
import java.time.*;
import java.math.*;
import java.security.*;
import javax.crypto.*;
import org.slf4j.LoggerFactory;
import org.slf4j.Logger;
import com.identityblitz.idp.federation.*;
import com.identityblitz.idp.federation.matching.*;
import com.identityblitz.idp.flow.common.api.*;
import com.identityblitz.idp.flow.common.model.*;
import com.identityblitz.idp.federation.matching.dynamic.*;
import java.util.function.Consumer;
import java.util.stream.Stream;
import java.util.stream.Collectors;
import org.codehaus.jackson.map.ObjectMapper;
import org.codehaus.jackson.type.TypeReference;
import com.identityblitz.idp.extensions.types.JsObject;
import com.identityblitz.idp.federation.matching.*;
import com.identityblitz.idp.flow.common.api.HttpFactory;
public class Esia_1Esia extends MatchingBlock {
private final Logger logger = LoggerFactory.getLogger("com.identityblitz.idp.federation.matching.dynamic");
@Override public MatchResult match(MatchingContext ctx, List<MatchingUser> users){
if (ctx.iteration() == 1) {
return find(ctx, MatchingFilter.empty().eq("uid", "00000").or().eq("uid", "test@test.ru"));
} else {
//return refine(ctx, Collections.singletonList((users.get(0))));
//return refine(ctx, users);
return matchByLogin(ctx);
}
};
@Override public Tuple2<JsObj, Set<String>> update(JsObj extAttrs, MatchingUser user, Boolean justMatched, HttpFactory httpFactory){
return change(JsObj.empty(), Collections.<String>emptySet());
};
}