public static BoxConfig readFrom ( Reader reader ) throws IOException { JsonObject config = JsonObject . readFrom ( reader ) ; JsonObject settings = ( JsonObject ) config . get ( "boxAppSettings" ) ; String clientId = settings . get ( "clientID" ) . asString ( ) ; String clientSecret = settings . get ( "clientSecret" ) . asString ( ) ; JsonObject appAuth = ( JsonObject ) settings . get ( "appAuth" ) ; String publicKeyId = appAuth . get ( "publicKeyID" ) . asString ( ) ; String privateKey = appAuth . get ( "privateKey" ) . asString ( ) ; String passphrase = appAuth . get ( "passphrase" ) . asString ( ) ; String enterpriseId = config . get ( "enterpriseID" ) . asString ( ) ; return new BoxConfig ( clientId , clientSecret , enterpriseId , publicKeyId , privateKey , passphrase ) ; }
Reads OAuth 2 . 0 with JWT app configurations from the reader . The file should be in JSON format .