Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clientId and clientSecret parameters are passed in the getClient function of the model #756

Open
tanvirismail opened this issue Feb 17, 2025 · 0 comments

Comments

@tanvirismail
Copy link

tanvirismail commented Feb 17, 2025

I can see that clientId and clientSecret parameters are passed in the getClient function of the model. This function is accessed from the token-handler.js and authorize-handler.js files. It is mentioned here that the token-handler.js file is accessed with clientId and clientSecret and the authorize-handler.js file is accessed only with clientId. I have fetched the client data from the database in the getClient function of the model, my codebase is

getClient: async function (clientId, clientSecret) { let result: any = {}; const oauthClient = await OauthClientRepository.findOne({id:clientId, secret: clientSecret}); if (oauthClient) { result = { clientId: oauthClient.id, userId: oauthClient.user_id, clientSecret: oauthClient.secret, grants: ['authorization_code', 'client_credentials', 'refresh_token', 'password'], redirectUris: [oauthClient.redirect], clientName: oauthClient.name }; } return new Promise(resolve => { resolve(result) }) },

Here since I have made a query with clientId and clientSecret. So it is important to pass these two parameters in the getClient function.
Or should I complete the query only with clientId?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant