cerco di postare i valori di portata sereval per consentire la mia domanda di qualche servizio google ...valori multipli scopo di OAuth2
ho provato con due campi di input
<input type="hidden" name="scope" value="https://www.googleapis.com/auth/calendar" />
<input type="hidden" name="scope" value="https://www.googleapis.com/auth/userinfo.email" />
e con un campo di input con + separatore
<input type="hidden" name="scope" value="https://www.googleapis.com/auth/calendar+https://www.googleapis.com/auth/userinfo.email" />
Quando invio il modulo con un solo ambito Funziona. altrimenti con il valore di portata sereval google mi redirect con questa descrizione errore:
http://localhost:49972/redirect.aspx#error=invalid_request&error_description=OAuth+2+parameters+can+only+have+a+single+value:+scope&error_uri=http://code.google.com/apis/accounts/docs/OAuth2.html
in Google getting started con OAuth2 funziona con due valori di portata.
Ecco il mio codice:
<form id="form1" method="post" action="https://accounts.google.com/o/oauth2/auth?" >
<div>
<input type="hidden" name="response_type" value="code" />
<input type="hidden" name="client_id" value="my client id" />
<input type="hidden" name="redirect_uri" value="http://localhost:49972/redirect.aspx" />
<input type="hidden" name="scope" value="https://www.googleapis.com/auth/calendar" />
<input type="hidden" name="scope" value="https://www.googleapis.com/auth/userinfo.email" />
<input type="hidden" name="state" value="/profile" />
<input type="submit" value="go" />
</div>
</form>
non ho il mio codice fino tomorow ma ringrazio Evan se sembra strano –
attualmente nel 2017 si dovrebbe usare 'value = "https://www.googleapis.com/auth/calendar email"' – user3479125
Per i curiosi, [RFC 6749, Sezione 3.3] (https://tools.ietf.org/html/rfc6749#section-3.3) definisce il parametro 'scope' come' Il valore del parametro scope è espresso come un elenco di stringhe delimitate da spazi e con distinzione tra maiuscole e minuscole. – davidjb