- This is the API Reference for the
oauth
export. For details how to use them see Oauth. - If you want to built yourself a custom Oauth flow see the pCloud's API Docs.
initOauthToken({
client_id: string,
redirect_uri: string,
response_type: "token" | "code",
receiveToken: (token, locationid) => void
});
You can use following method for Oauth authenticate without redirect uri(see listfolder example):
initOauthPollToken({
client_id: string,
receiveToken: () => void,
onError:() => void
});
// inside redirect_uri window
<script>
pCloudSdk.oauth.popup();
</script>
getTokenFromCode(
code: string,
client_id: string,
app_secret: string
): Promise<{ userid, access_token }>
code
can be received either manually by the user via copy & paste (see oauth example) or by specifyingresponse_type: "code"
toinitOauthToken
.