Validate if the application name is existing in the user profile.
There are a few ways that you can do this, the first would be to use the Users API, but it depends if you’re assigning the users to the applications via groups. The second would be to use the Apps API.
Apps | Okta Developer - Allows you to query for all applications assigned to a user.
If the application exists give the user access
This can be accomplished by assigning a user to a group and then the group to the application or assigning a user directly.