private String extractGrantCode ( String urlString ) throws MalformedURLException { URL url = new URL ( urlString ) ; String code = Utils . getParameterValueFromQuery ( url . getQuery ( ) , "code" ) ; if ( code == null ) { throw new RuntimeException ( "Failed to extract grant code from url" ) ; } logger . debug ( "Grant code extracted successfully" ) ; return code ; }
Extract grant code from url string