How to use the @esri/arcgis-rest-auth.UserSession.beginOAuth2 function in @esri/arcgis-rest-auth

To help you get started, we’ve selected a few @esri/arcgis-rest-auth examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Esri / arcgis-rest-js / demos / vue / src / components / App.vue View on Github external
signInWithPopup() {
      if (this.requireClientId()) {
        UserSession.beginOAuth2({
          clientId: this.clientId,
          // Passing the clientid here is only a requirement of this demo where we allow
          // dynamic clientids via input. Typically you would have this hard-coded on
          // the authorization callback.
          redirectUri: `${this.redirect_uri}#/authenticate?clientID=${
            this.clientId
          }`,
          popup: true
        })
          .then(session => {
            // Upon successful login, update the application's store with this new
            // session.
            this.$store.dispatch("updateSession", session);
          })
          .catch(error);
      }
github Esri / arcgis-rest-js / demos / vue / src / components / App.vue View on Github external
signInWithInlineRedirect() {
      if (this.requireClientId()) {
        UserSession.beginOAuth2({
          clientId: this.clientId,
          redirectUri: `${this.redirect_uri}#/authenticate?clientID=${
            this.clientId
          }`,
          popup: false
        });
      }
    },
    // Function to log the use out of the current session.