package Ġcom . ba ul supp . ok url . services . trello Ċ Ċ import Ġcom . ba ul supp . sch output . handler . Output Handler Ċ import Ġcom . ba ul supp . ok url . secrets . Secrets Ċ import Ġokhttp 3 . Response Ċ import Ġjava . net . URL Encoder Ċ Ċ object ĠT rello Auth Flow Ġ{ ĊĠ Ġsuspend Ġfun Ġlogin ( ĊĠĠĠ Ġoutput Handler : ĠOutput Handler < Response > ĊĠ Ġ): ĠT rello Token Ġ{ ĊĠĠĠ Ġval Ġclient Key Ġ= ĠSec rets . prompt (" T rello ĠAPI ĠKey ", Ġ" trello . apiKey ", Ġ"", Ġfalse ) ĊĊĠĠĠ Ġval Ġscopes Ġ= ĠSec rets . prompt Array (" Scopes ", Ġ" trello . scopes ", ĠlistOf (" read ", Ġ" write ", Ġ" account ")) ĊĠĠĠ Ġval Ġscopes String Ġ= ĠURL Encoder . encode ( scopes . join ToString ("," ), Ġ" UTF - 8 ") ĊĊĠĠĠ Ġval Ġlogin Url Ġ= ĊĠĠĠĠĠ Ġ" https :// trello . com / 1 / authorize ? expiration = never & name = Ok Social & scope =$ scopes String & key =$ client Key & response _ type = token " ĊĊĠĠĠ Ġoutput Handler . open Link ( login Url ) ĊĊĠĠĠ Ġval Ġtoken Ġ= ĠSystem . console (). readLine (" Enter ĠToken : Ġ") ĊĊĠĠĠ Ġreturn ĠT rello Token ( token , Ġclient Key ) ĊĠ Ġ} Ċ } Ċ