\doxysection{com.\+tritondigital.\+util.\+Auth\+Util Class Reference}
\hypertarget{classcom_1_1tritondigital_1_1util_1_1AuthUtil}{}\label{classcom_1_1tritondigital_1_1util_1_1AuthUtil}\index{com.tritondigital.util.AuthUtil@{com.tritondigital.util.AuthUtil}}


Utility to create an authentication token.  


\doxysubsubsection*{Static Public Member Functions}
\begin{DoxyCompactItemize}
\item 
static String \mbox{\hyperlink{classcom_1_1tritondigital_1_1util_1_1AuthUtil_a16cc19bcac9da8f0b97fc89b609a1198}{create\+Jwt\+Token}} (String secret\+Key, String secret\+Key\+Id, boolean registered\+User, String user\+Id, Map$<$ String, String $>$ targeting\+Params)
\begin{DoxyCompactList}\small\item\em Creates a JWT token. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
Utility to create an authentication token. 

\begin{DoxyParagraph}{Example -\/ Token Authorization (self signed)}

\begin{DoxyCode}{0}
\DoxyCodeLine{\textcolor{comment}{//\ Create\ the\ targeting\ parameters}}
\DoxyCodeLine{HashMap<String,\ String>\ targetingParams\ =\ \textcolor{keyword}{new}\ HashMap();}
\DoxyCodeLine{targetingParams.put(StreamUrlBuilder.COUNTRY\_CODE,\ \ \textcolor{stringliteral}{"{}US"{}});}
\DoxyCodeLine{targetingParams.put(StreamUrlBuilder.POSTAL\_CODE,\ \ \ \textcolor{stringliteral}{"{}12345"{}});}
\DoxyCodeLine{targetingParams.put(StreamUrlBuilder.GENDER,\ \ \ \ \ \ \ \ \textcolor{stringliteral}{"{}m"{}});}
\DoxyCodeLine{targetingParams.put(StreamUrlBuilder.YEAR\_OF\_BIRTH,\ \textcolor{stringliteral}{"{}1990"{}});}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{comment}{//\ Create\ the\ authentication\ token}}
\DoxyCodeLine{String\ token\ =\ AuthUtil.createJwtToken(\textcolor{stringliteral}{"{}MySecretKey"{}},\ \textcolor{stringliteral}{"{}MySecretKeyId"{}},\ \textcolor{keyword}{true},\ \textcolor{stringliteral}{"{}foo@bar.com"{}},\ targetingParams);}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{comment}{//\ Create\ the\ player\ settings.}}
\DoxyCodeLine{Bundle\ settings\ =\ \textcolor{keyword}{new}\ Bundle();}
\DoxyCodeLine{settings.putBoolean(TritonPlayer.SETTINGS\_TARGETING\_LOCATION\_TRACKING\_ENABLED,\ \textcolor{keyword}{true});}
\DoxyCodeLine{settings.putSerializable(TritonPlayer.SETTINGS\_TARGETING\_PARAMS,\ targetingParams);}
\DoxyCodeLine{settings.putString(TritonPlayer.SETTINGS\_AUTH\_TOKEN,\ \ \ \ \ \ \ \ \ \ \ \ \ token);}
\DoxyCodeLine{settings.putString(TritonPlayer.SETTINGS\_STATION\_BROADCASTER,\ \ \ \ \textcolor{stringliteral}{"{}Triton\ Digital"{}});}
\DoxyCodeLine{settings.putString(TritonPlayer.SETTINGS\_STATION\_NAME,\ \ \ \ \ \ \ \ \ \ \ \textcolor{stringliteral}{"{}MOBILEFM"{}});}
\DoxyCodeLine{settings.putString(TritonPlayer.SETTINGS\_STATION\_MOUNT,\ \ \ \ \ \ \ \ \ \ \textcolor{stringliteral}{"{}MOBILEFM\_AACV2"{}});}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{comment}{//\ Create\ the\ player.}}
\DoxyCodeLine{TritonPlayer\ player\ =\ \textcolor{keyword}{new}\ TritonPlayer(\textcolor{keyword}{this},\ settings);}
\DoxyCodeLine{player.play();}

\end{DoxyCode}
 
\end{DoxyParagraph}


\doxysubsection{Member Function Documentation}
\Hypertarget{classcom_1_1tritondigital_1_1util_1_1AuthUtil_a16cc19bcac9da8f0b97fc89b609a1198}\label{classcom_1_1tritondigital_1_1util_1_1AuthUtil_a16cc19bcac9da8f0b97fc89b609a1198} 
\index{com.tritondigital.util.AuthUtil@{com.tritondigital.util.AuthUtil}!createJwtToken@{createJwtToken}}
\index{createJwtToken@{createJwtToken}!com.tritondigital.util.AuthUtil@{com.tritondigital.util.AuthUtil}}
\doxysubsubsection{\texorpdfstring{createJwtToken()}{createJwtToken()}}
{\footnotesize\ttfamily static String com.\+tritondigital.\+util.\+Auth\+Util.\+create\+Jwt\+Token (\begin{DoxyParamCaption}\item[{String}]{secret\+Key,  }\item[{String}]{secret\+Key\+Id,  }\item[{boolean}]{registered\+User,  }\item[{String}]{user\+Id,  }\item[{Map$<$ String, String $>$}]{targeting\+Params }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



Creates a JWT token. 


\begin{DoxyParams}{Parameters}
{\em secret\+Key} & HMAC secret key (provided by Triton) \\
\hline
{\em secret\+Key\+Id} & The Secret Key\textquotesingle{}s ID or "{}null"{} (provided by Triton) \\
\hline
{\em registered\+User} & True if the user is considered registered \\
\hline
{\em user\+Id} & User ID (from authentication). Can be null \\
\hline
{\em targeting\+Params} & Triton targeting params (see Triton\+Player\+::\+SETTINGS\+\_\+\+TARGETING\+\_\+\+PARAMS). Can be null \\
\hline
\end{DoxyParams}


The documentation for this class was generated from the following file\+:\begin{DoxyCompactItemize}
\item 
sdk/src/main/java/com/tritondigital/util/Auth\+Util.\+java\end{DoxyCompactItemize}
