OAuth2 not working with any APIs

I have Add an OAuth2 Application in my nextcloud.

Now I am able to successfully generate an access token and refresh token using postman. But the access_token generated cannot be used to authenticate any of the nextcloud api. I have tried with user Provisioning API but it is giving 401 error. Access_token is generated with admin credentials for testing.

Does it work using Basic Auth?

That’s the only approach documented for the Provisioning API.


(P.S. This is not my wheelhouse, but just something to at least confirm works first).

Yes, It is working with Basic Auth.

Where & how can I use AUTH2 for authentication.

Try using Bearer instead of Basic in your Authorization header. I’d only expect to see Basic for base64 encoded (but not encrypted) credentials.