Am able to create the records as an admin using the OAuth access_token. But, here I need to create a record as another user with the OAuth access_token.
Could you please share the sample code.
Thanks in Advance.
Any given access token is associated with a particular user, and using it allows you to perform operations on behalf of that particular user.
If you specify your own username when you go through whichever OAuth flow you are using, then you get an access token to perform operations on your behalf.
If you want to perform operations on behalf of another user, you'll need to go through an appropriate OAuth flow to get an appropriate access token.
The JWT Bearer flow is the only one I know of where you can log in as another user without needing that user's password (provided your connected app is set up to have "selected profiles are pre-authorized").