You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@nifi.apache.org by Nicola Biadene <ni...@targatelematics.com> on 2022/03/04 13:52:47 UTC

InvokeHTTP : how to set a bearer token auth

Dear all,

how can I set a bearer token on a InvokeHTTP operator?

I cannot find documentation and a field referring to this parameter.


Regards.


Nicola Biadene
Software Engineer
nicola.biadene@targatelematics.com<ma...@targatelematics.com>

[/Users/video/Desktop/Schermata 2019-09-11 alle 12.12.03.png]
Targa Telematics S.p.A.
Via E. Reginato, 87 - 31100 Treviso - Italia
Tel. +39 0422 247 911
www.targatelematics.com


[../../../../../../../Desktop/Firme_TT/png/singole/icone_social_Tavola%20dis]<https://www.facebook.com/TargaTelematics/>[../../../../../../../Desktop/Firme_TT/png/singole/icone_social_Tavola%20disegno%2]<http://www.linkedin.com/company/targa-telematics/>[../../../../../../../Desktop/Firme_TT/png/singole/icone_social_Tavola%20disegno%201]<https://twitter.com/targatelematics>[../../../../../../../Desktop/Firme_TT/png/singole/icone_social_Tavola%20disegno%201]<https://www.instagram.com/targatelematics/>


Stampa questa eMail solo se realmente necessario

Le informazioni contenute nella comunicazione che precede possono essere riservate e sono, comunque, destinate esclusivamente alla persona o all'ente sopraindicati. La diffusione, distribuzione e/o copiatura del documento trasmesso da parte di qualsiasi soggetto diverso dal destinatario è proibita. La sicurezza e la correttezza dei messaggi di posta elettronica non possono essere garantite. Se avete ricevuto questo messaggio per errore, Vi preghiamo di contattarci immediatamente e di eliminarlo dai vostri sistemi. Informativa sulla privacy<https://www.targatelematics.com/privacy/> di Targa Telematics S.p.A.

Please consider your environmental responsibility before printing this eMail

This communication is intended only for use by the addressee. It may contain confidential or privileged information. Transmission cannot be guaranteed to be secure or error-free. If you receive this communication unintentionally, please inform us immediately and delete it from your systems. Targa Telematics S.p.A. privacy policy<https://www.targatelematics.com/en/privacy/>.



Re: InvokeHTTP : how to set a bearer token auth

Posted by Steven Matison <st...@cloudera.com.INVALID>.
Check out this article here:

https://pierrevillard.com/2017/01/31/nifi-and-oauth-2-0-to-request-wordpress-api/ <https://pierrevillard.com/2017/01/31/nifi-and-oauth-2-0-to-request-wordpress-api/>


TL;DR; you simply add the property you want to the processor.   You just need to make sure you get it formatted correctly.  I would recommend or assume you already have examples, for example a sample postman call, so just duplicate the same headers until NiFi connects.





> On Mar 4, 2022, at 8:52 AM, Nicola Biadene <ni...@targatelematics.com> wrote:
> 
> Dear all,
>  
> how can I set a bearer token on a InvokeHTTP operator?
>  
> I cannot find documentation and a field referring to this parameter.
>  
>  
> Regards.
>  
>  
> Nicola Biadene
> Software Engineer
> nicola.biadene@targatelematics.com <ma...@targatelematics.com>
> 
> 
> Targa Telematics S.p.A.
> Via E. Reginato, 87 – 31100 Treviso – Italia
> Tel. +39 0422 247 911
>  <>www.targatelematics.com <http://www.targatelematics.com/>
>  
>  
>  <https://www.facebook.com/TargaTelematics/> <http://www.linkedin.com/company/targa-telematics/> <https://twitter.com/targatelematics> <https://www.instagram.com/targatelematics/>
>  
>   <>
> Stampa questa eMail solo se realmente necessario
>  
> Le informazioni contenute nella comunicazione che precede possono essere riservate e sono, comunque, destinate esclusivamente alla persona o all'ente sopraindicati. La diffusione, distribuzione e/o copiatura del documento trasmesso da parte di qualsiasi soggetto diverso dal destinatario è proibita. La sicurezza e la correttezza dei messaggi di posta elettronica non possono essere garantite. Se avete ricevuto questo messaggio per errore, Vi preghiamo di contattarci immediatamente e di eliminarlo dai vostri sistemi. Informativa sulla privacy <https://www.targatelematics.com/privacy/> di Targa Telematics S.p.A.
>  
> 
> Please consider your environmental responsibility before printing this eMail
>  
> This communication is intended only for use by the addressee. It may contain confidential or privileged information. Transmission cannot be guaranteed to be secure or error-free. If you receive this communication unintentionally, please inform us immediately and delete it from your systems. Targa Telematics S.p.A. privacy policy <https://www.targatelematics.com/en/privacy/>.


Re: InvokeHTTP : how to set a bearer token auth

Posted by Mike Thomsen <mi...@gmail.com>.
1.16.0 will provide integration between the OAuth2TokenProvider controller
service and InvokeHTTP so this will all be OBE at that point.

On Fri, Mar 4, 2022 at 9:38 AM Jim Halfpenny <ji...@source321.com> wrote:

> Hi Nicola,
> The bearer token is set in the Authorization: header of the HTTP request.
> What you need to do is define this header by adding a property named
> Authorization to the processor (see screenshot). The value of this should
> be "Bearer #{token}”, replacing #{token} with your actual token value. It’s
> good practice to define the token as a parameter and reference it using the
> #{param_name} syntax to make it easier to manage.
>
>
> Kind regards,
> Jim
>
>
>
> On 4 Mar 2022, at 13:52, Nicola Biadene <
> nicola.biadene@targatelematics.com> wrote:
>
> Dear all,
>
> how can I set a bearer token on a InvokeHTTP operator?
>
> I cannot find documentation and a field referring to this parameter.
>
>
> Regards.
>
>
> *Nicola Biadene*
> *Software Engineer*
> *nicola.biadene@targatelematics.com <ni...@targatelematics.com>*
>
> [image: /Users/video/Desktop/Schermata 2019-09-11 alle 12.12.03.png]
> *Targa Telematics S.p.A.*
> *Via E. Reginato, 87 – 31100 Treviso – Italia*
> *Tel. +39 0422 247 911*
> *www.targatelematics.com <http://www.targatelematics.com/>*
>
>
> [image:
> ../../../../../../../Desktop/Firme_TT/png/singole/icone_social_Tavola%20dis]
> <https://www.facebook.com/TargaTelematics/>[image:
> ../../../../../../../Desktop/Firme_TT/png/singole/icone_social_Tavola%20disegno%2]
> <http://www.linkedin.com/company/targa-telematics/>[image:
> ../../../../../../../Desktop/Firme_TT/png/singole/icone_social_Tavola%20disegno%201]
> <https://twitter.com/targatelematics>[image:
> ../../../../../../../Desktop/Firme_TT/png/singole/icone_social_Tavola%20disegno%201]
> <https://www.instagram.com/targatelematics/>
>
>
> *Stampa questa eMail solo se realmente necessario*
>
> Le informazioni contenute nella comunicazione che precede possono essere
> riservate e sono, comunque, destinate esclusivamente alla persona o
> all'ente sopraindicati. La diffusione, distribuzione e/o copiatura del
> documento trasmesso da parte di qualsiasi soggetto diverso dal destinatario
> è proibita. La sicurezza e la correttezza dei messaggi di posta elettronica
> non possono essere garantite. Se avete ricevuto questo messaggio per
> errore, Vi preghiamo di contattarci immediatamente e di eliminarlo dai
> vostri sistemi. Informativa sulla privacy
> <https://www.targatelematics.com/privacy/> di Targa Telematics S.p.A.
>
>
> *Please consider your environmental responsibility before printing this
> eMail*
>
> This communication is intended only for use by the addressee. It may
> contain confidential or privileged information. Transmission cannot be
> guaranteed to be secure or error-free. If you receive this communication
> unintentionally, please inform us immediately and delete it from your
> systems. Targa Telematics S.p.A. *privacy policy
> <https://www.targatelematics.com/en/privacy/>*.
>
>
>

Re: InvokeHTTP : how to set a bearer token auth

Posted by Jim Halfpenny <ji...@source321.com>.
Hi Nicola,
The bearer token is set in the Authorization: header of the HTTP request. What you need to do is define this header by adding a property named Authorization to the processor (see screenshot). The value of this should be "Bearer #{token}”, replacing #{token} with your actual token value. It’s good practice to define the token as a parameter and reference it using the #{param_name} syntax to make it easier to manage.



Kind regards,
Jim



> On 4 Mar 2022, at 13:52, Nicola Biadene <ni...@targatelematics.com> wrote:
> 
> Dear all,
>  
> how can I set a bearer token on a InvokeHTTP operator?
>  
> I cannot find documentation and a field referring to this parameter.
>  
>  
> Regards.
>  
>  
> Nicola Biadene
> Software Engineer
> nicola.biadene@targatelematics.com <ma...@targatelematics.com>
> 
> 
> Targa Telematics S.p.A.
> Via E. Reginato, 87 – 31100 Treviso – Italia
> Tel. +39 0422 247 911
>  <>www.targatelematics.com <http://www.targatelematics.com/>
>  
>  
>  <https://www.facebook.com/TargaTelematics/> <http://www.linkedin.com/company/targa-telematics/> <https://twitter.com/targatelematics> <https://www.instagram.com/targatelematics/>
>  
>   <>
> Stampa questa eMail solo se realmente necessario
>  
> Le informazioni contenute nella comunicazione che precede possono essere riservate e sono, comunque, destinate esclusivamente alla persona o all'ente sopraindicati. La diffusione, distribuzione e/o copiatura del documento trasmesso da parte di qualsiasi soggetto diverso dal destinatario è proibita. La sicurezza e la correttezza dei messaggi di posta elettronica non possono essere garantite. Se avete ricevuto questo messaggio per errore, Vi preghiamo di contattarci immediatamente e di eliminarlo dai vostri sistemi. Informativa sulla privacy <https://www.targatelematics.com/privacy/> di Targa Telematics S.p.A.
>  
> 
> Please consider your environmental responsibility before printing this eMail
>  
> This communication is intended only for use by the addressee. It may contain confidential or privileged information. Transmission cannot be guaranteed to be secure or error-free. If you receive this communication unintentionally, please inform us immediately and delete it from your systems. Targa Telematics S.p.A. privacy policy <https://www.targatelematics.com/en/privacy/>.