You are probably doing something in the code that requires permissions
that by default are only granted to code that runs from the local
machine. If you look at the exception message and figure out which
method throws it, you can read in the docs which permissions are
required.