Hi @yehtetlwin and welcome to the Auth0 Community!
Could you please confirm that going into Applications - Application - Connections tab, the Username-Password-Authentication connection is toggled on? I’m asking because a common cause for this error is that the Application doesn’t have access to the database.
I finally can access token by Basic Authorization with Client ID and Client Secret in Header’s “Authorization” and other params as a form of URL Params.
But I cannot find any tutorial that mentions to use Client ID and Client Secret as Basic Authorization in Header, so I doubt it is a correct way to do it.
Yes, using the Authorization header with HTTP Basic authentication is a correct, standard, and often recommended way for a confidential client to authenticate itself when calling the /oauth/token endpoint.
The reason you may not see this method in every tutorial is that some examples simplify the request by putting the client_id and client_secret directly in the request body. Both methods are supported by the OAuth 2.0 specification, but using the Authorization header is generally considered a cleaner and better practice.
Your method is perfectly valid according to the OAuth 2.0 specification (RFC 6749, Section 2.3.1), which defines client authentication for confidential clients.