Actual source code: boxobtainrefreshtoken.c


  2: /*
  3:      Obtains a refresh token that you can use in the future to access Box from PETSc code

  5:      You can run PETSc programs with -box_refresh_token XXXX where XXX is the refresh token to access your Box

  7: */

  9: #include <petscsys.h>

 11: int main(int argc,char **argv)
 12: {
 13:   char           access_token[512],refresh_token[512];

 15:   PetscInitialize(&argc,&argv,NULL,NULL);
 16:   PetscBoxAuthorize(PETSC_COMM_WORLD,access_token,refresh_token,sizeof(access_token));
 17:   PetscPrintf(PETSC_COMM_WORLD,"Your one time refresh token is %s\n",refresh_token);
 18:   PetscFinalize();
 19:   return 0;
 20: }

 22: /*TEST

 24:    build:
 25:      requires: ssl saws

 27:    test:
 28:      TODO: determine how to run this test without going through the browser

 30: TEST*/