How to test CheckPhoneNumber verification API in wso2 api manager - wso2

I follow link
I created API for CheckPhoneNumber 'POST' and 'GET' type request as given documentation.
How to test that API?
I searched many sites they are using 'API Console' tab in store. There is required Access Token. I am creating Access 'Production Keys' from DefaultApplication. that Access token am using it is giving error
<ams:fault xmlns:ams="http://wso2.org/apimanager/security">
<ams:code>900908</ams:code>
<ams:message>Resource forbidden </ams:message>
<ams:description>Access failure for API: /phoneverify/1.0.0, version: 1.0.0 status: (900908) - Resource forbidden </ams:description>
</ams:fault>
If there is another way to create Access Token?
Or tell me if am doing something wrong for testing API.

You need to subscribe the Application to the API.
Ref: https://docs.wso2.com/display/AM260/Subscribe+to+an+API

As #Bee pointed out above, you don't have issues with access token, the problem is you have not subscribed to your api in the api manager. error code 900908 implies the API is not subscribed to by the app trying to invoke it.

Related

WSO2 IDENTITY SERVER SCIM2.0 API - GET USER BY ID

I want to use the wso2 SCIM2.0 API for CRUD operations on my users.
When I call the API to get ALL the users, it works, but when I try to call the API to get a specific User by its ID, it returns a 403 forbidden error.
The API I'm calling is this one:
https://localhost:9443/t/carbon.super/scim2/Users/29ae81f4-37eb-4e5c-a3c9-33cba98f4f47
and I'm passing the access token generated with the scope: internal_user_mgt_list
and the users logged in that is trying to call the API has all the User Managment permissions.
I solved the problem. The documentation specifies the wrong scope. The required scope is not internal_user_mgt_list but internal_user_mgt_view

need access token to authorization and access token is provided with another service with Basic Auth. Does WSO2 have this feature?

I need this feature in WSO2 Publisher or Devportal:
I have one api that need dynamic access token and Also I have another api with static Basic Authentication to provide that dynamic Access Token. Unfortunately I could not solve this with mediation. The policy is simple But I don't know whether WSO2 has this simple feature or not?
process: token api with basic Auth ==> provide dynamic access token ==> use access token in main api body and send.
Main API is our Endpoint in WSO2 API.
I could not solve this with Endpoint Security(Oauth2) and mediation(XML).
Version of WSO2-AM is 4.1.0 and this version is latest now.
Have you thought about using a vault, such as Hashicorp Vault, to fetch the the basic auth credentials.
From there use a custom sequence [2] that gets the token (step 1 in your diagram) and then get the token check results you need (step 2).
[1] https://apim.docs.wso2.com/en/latest/install-and-setup/setup/mi-setup/security/using-hashicorp-secrets/
[2] https://apim.docs.wso2.com/en/latest/reference/mediators/sequence-mediator/

Linkedin V2 API (POSTMAN)

I want to create application Which will share post in company page.
I have Permissions in linkedin :
Using documentation im trying to get Token. but i have error :
{
"error": "access_denied",
"error_description": "This application is not allowed to create application tokens"
}
https://learn.microsoft.com/en-us/linkedin/shared/authentication/client-credentials-flow?context=linkedin/context
*** Real credentials was Replaced by xxxxx
Use this Postman Collection for the LinkedIn Oauth 2.0 API. And follow these steps in this article
All the permissions you have are 3-legged permission and you are trying to get token using 2-legged process.
Please follow below workflow to create access/bearer token using 3-legged flow:
https://learn.microsoft.com/en-us/linkedin/shared/authentication/authorization-code-flow?context=linkedin/context
If your application needs access to information from a member's LinkedIn profile, use the Authorization Code Flow to request permission from the member.
PS: Company page post also requires Authorization Code Flow.
You can use Postman Collections here to view some examples and use cases.
An update documentation for Postman Oauth 3 is here
Follow these steps in this article
https://www.linkedin.com/oauth/v2/authorization?
client_id=yyyyy
&redirect_uri=xxxx
&scope=r_liteprofile%20r_emailaddress%20w_member_social
&response_type=zzzzz

WSO2 revoke api

I was curious how can see the revoke api end point exists.The url configured is
https://localhost:9443/revoke
But I could see the api listed under the started application or under api.
I even tried retrieving the wadl from the url but it did not return anything.
Do we need to explicitly publish it or it gets done automatically when we start the wso2server ? Or Do we need to install something other than the wso2 api manager to get this api?
When I browse the endpoint https://localhost:9443/revoke/?_wadl , I get error
405 - method not allowed
The port should be 8243.
And it's not a SOAP service.
Ref: https://docs.wso2.com/display/AM260/Token+API#TokenAPI-Revokingaccesstokens

Error while publishing an API in the WSO2 API Manager

When I publish an API in the WSO2 API Manager, the following error occurs:
Gateway Failures
Failed to Publish Environments
Production and Sandbox
Error while obtaining API information from gateway. Error while obtaining API information from gateway. Authentication failure
This could be due to an authentication failure. Please check whether username/password within <Environments> content element of root <APIGateway> element in api-manager.xml (<APIM_HOME>/repository/conf/api-manager.xml) is correct
I've had this issue.
When checking the logs I saw this:
URL context: /hrs/admihrsd/osb/documentWS/2.0.0 is already registered with the API: novakgo--hrs-admihrsd-osb-document-service:v2.0.0
The issue was someone was trying to publish a new API with the same context as another one. They should change the context and publish again, and the error is fixed. Context have to be unique.