Representation toRepresentation(Context context,Request request,Response response,AuthorizationToken authorizationToken,String redirectUri){
  final Form tokenForm=toForm(authorizationToken);
  final Reference redirectReference=new Reference(redirectUri);
  if (authorizationToken.isFragment()) {
    redirectReference.setFragment(tokenForm.getQueryString());
  }
 else {
    final Iterator<Parameter> iter=tokenForm.iterator();
    while (iter.hasNext()) {
      redirectReference.addQueryParameter(iter.next());
    }
  }
  if (isFormPostRequest(requestFactory.create(request))) {
    return getFormPostRepresentation(context,authorizationToken,redirectReference.toString());
  }
  final Redirector dispatcher=new Redirector(context,redirectReference.toString(),Redirector.MODE_CLIENT_FOUND);
  dispatcher.handle(request,response);
  return response == null ? null : response.getEntity();
}

Representation toRepresentation ( Context context , Request request , Response response , AuthorizationToken authorizationToken , String redirectUri ) { final Form tokenForm = toForm ( authorizationToken ) ; final Reference redirectReference = new Reference ( redirectUri ) ; if ( authorizationToken . isFragment ( ) ) { redirectReference . setFragment ( tokenForm . getQueryString ( ) ) ; } else { final Iterator < Parameter > iter = tokenForm . iterator ( ) ; while ( iter . hasNext ( ) ) { redirectReference . addQueryParameter ( iter . next ( ) ) ; } } if ( isFormPostRequest ( requestFactory . create ( request ) ) ) { return getFormPostRepresentation ( context , authorizationToken , redirectReference . toString ( ) ) ; } final Redirector dispatcher = new Redirector ( context , redirectReference . toString ( ) , Redirector . MODE_CLIENT_FOUND ) ; dispatcher . handle ( request , response ) ; return response == null ? null : response . getEntity ( ) ; }
converts the authorization token into a representation to send back to the user agent .
