anchor.diff:  %% ====================================================================
   prepare_validation_parameters() ->
       try
  +        % Make sure received endpoint is really the PLGrid endpoint
  +        EndpointURL = wf:q(<<?openid_op_endpoint_key>>),
  +        true = (discover_op_endpoint(?xrds_url) =:= EndpointURL),
  +
           % 'openid.signed' contains parameters that must be contained in validation request
           SignedArgsNoPrefix = binary:split(wf:q(<<?openid_signed_key>>), <<",">>, [global]),
           % Add 'openid.' prefix to all parameters
  
positive.code: %% ====================================================================
  retrieve_user_info() ->
      try
          Login = gui_utils:to_list(wf:q(<<?openid_login_key>>)),
          % Login must be retrieved from OpenID, other info is not mandatory.
          case Login of
              [] -> throw(login_undefined);
              _ -> ok
          end,
          Name = gui_utils:to_list(wf:q(<<?openid_name_key>>)),
          Teams = parse_teams(gui_utils:to_list(wf:q(<<?openid_teams_key>>))),
          Email = gui_utils:to_list(wf:q(<<?openid_email_key>>)),
          DN1 = gui_utils:to_list(wf:q(<<?openid_dn1_key>>)),
          DN2 = gui_utils:to_list(wf:q(<<?openid_dn2_key>>)),
          DN3 = gui_utils:to_list(wf:q(<<?openid_dn3_key>>)),
          DnList = lists:filter(
              fun(X) ->
                  (X /= [])
  
negative.code: %% ====================================================================
  %% Internal functions
  %% ====================================================================
  
  %% get_signed_param/2
  %% ====================================================================
  %% @doc
  %% Retrieves given request parameter, but only if it was signed by the provider
  %% @end
  -spec get_signed_param(binary(), [binary()]) -> string().
  %% ====================================================================
  get_signed_param(ParamName, SignedParams) ->
      case lists:member(ParamName, SignedParams) of
          true -> gui_utils:to_list(wf:q(ParamName));
          false -> []
      end.
  
  
  %% discover_op_endpoint/1
  %% ====================================================================
  