Granting the permissions and noting the application ID