 
 <PRIVATE
 
-:: signed-oauth-request-params ( request params -- params )
+:: signed-oauth-request-params ( request params -- oauth-params )
     request url>>
     request method>>
     params consumer-token>>

    ] make-token-params
    sign-params ;

: build-auth-string ( params -- string )
    [ [ present url-encode-full ] bi@ "\"" "\"" surround "=" glue ] { } assoc>map
    ", " join "OAuth realm=\"\", " prepend ;


        ] bi
    ] H{ } make ; inline

! Checksum all the params but only return the oauth_ params for use in the auth header.
! See https://github.com/factor/factor/issues/2487
:: sign-params ( url request-method consumer-token request-token params -- oauth-params )
    params sort-keys :> params
    url request-method params signature-base-string :> sbs
    consumer-token secret>> request-token dup [ secret>> ] when hmac-key :> key
    sbs key sha1 hmac-bytes >base64 >string :> signature
    params { "oauth_signature" signature } prefix
    [ "oauth_" head? ] filter-keys ;

: extract-user-data ( assoc -- assoc' )
    [
