anchor.diff:  
   
   %% @private
  --spec build_token_verification_auth_ctx(entity_logic:data()) -> aai:auth_ctx().
  -build_token_verification_auth_ctx(Data) ->
  -    PeerIp = utils:null_to_undefined(maps:get(<<"peerIp">>, Data, undefined)),
  +-spec build_token_verification_auth_ctx(aai:auth(), entity_logic:data()) -> aai:auth_ctx().
  +build_token_verification_auth_ctx(Auth, Data) ->
  +    PeerIp = case maps:find(<<"peerIp">>, Data) of
  +        {ok, P} -> utils:null_to_undefined(P);
  +        error -> Auth#auth.peer_ip
  +    end,
       Interface = utils:null_to_undefined(maps:get(<<"interface">>, Data, undefined)),
       Service = case utils:null_to_undefined(maps:get(<<"serviceToken">>, Data, undefined)) of
           undefined ->
  
positive.code: create(#el_req{gri = #gri{id = undefined, aspect = {provider_temporary_token, ProviderId}}, data = Data}) ->
      create_temporary_token(?SUB(?ONEPROVIDER, ProviderId), Data);
  
  create(#el_req{auth = ?PROVIDER(ProviderId), gri = #gri{id = undefined, aspect = {offline_user_access_token, UserId}}, data = Data}) ->
      Token = maps:get(<<"token">>, Data),
      AuthCtx = build_token_verification_auth_ctx(Data),
      case token_auth:verify_access_token(Token, AuthCtx) of
          {ok, #auth{subject = ?SUB(user, UserId), caveats = OriginalCaveats}} ->
              create_temporary_token(?SUB(user, UserId), #{
                  <<"type">> => ?ACCESS_TOKEN,
                  <<"caveats">> => provider_offline_access:build_token_caveats(
                      OriginalCaveats, ProviderId, ?OFFLINE_ACCESS_TOKEN_TTL
                  )
              });
          {ok, #auth{}} ->
  
negative.code:                 {error, _} = Error1 -> throw(Error1)
              end
      end,
      Consumer = case maps:find(<<"consumerToken">>, Data) of
          error ->
              Auth#auth.subject;
          {ok, null} ->
              undefined;
          {ok, ConsumerToken} ->
              case token_auth:verify_consumer_token(ConsumerToken, #auth_ctx{ip = PeerIp, interface = Interface}) of
                  {ok, Csm} -> Csm;
                  {error, _} = Error2 -> throw(Error2)
  