code: public URI getRedirectToFromState(final String state)
  	{
  		final String[] pieces = decodeState(state).split(" ", 2);
  
  		if (!StringUtils.equals(callbackNonce, pieces[0]))
  		{
  			// The callback nonce is not what we expect; this is usually caused by:
  			// - The user has followed a previous oauth callback entry from their history
  			// - The user has accessed a service via a non-canonical endpoint and been redirected by the oauth server to the canonical one
  			//   which means the original nonce stored in the session is not available to this session.
  
  			// To get around this, we simply redirect the user to the root of this service so they can start the oauth flow again
  			throw new LiteralRestResponseException(Response.seeOther(URI.create("/")).build());
  		}
  
  		if (pieces.length == 2)
  			return URI.create(pieces[1]);
  		else
  			return null;
  	}
docs: Decode the state to retrieve the redirectTo value
  
  @param state
  
  @return