-
Notifications
You must be signed in to change notification settings - Fork 128
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Invalid Access Token #11
Comments
I had not checked on Lipa na Mpesa Online on my App |
The problem happens when the Lipa na Mpesa Online has yet not approved in your app that you created at .https://developer.safaricom.co.ke To check whether app has been approvedGo to your apps: Select You will find two products :
You will see whether they have been approved or not depending on which product you are using. |
Hallo there. I am facing the same issue right now. I've checked
|
Your access token expires in an hour, make sure you have the correct API
products enabled and refresh your token before an hour
…On Wed, Oct 3, 2018, 17:53 Dennis Orina ***@***.***> wrote:
Hallo there.
I am facing the same issue right now. I've checked products as explained
above, mine is approved. But I still get the error.
{ "requestId":"11559-988723-1", "errorCode": "404.001.03", "errorMessage":
"Invalid Access Token" }
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#11 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AGMwCGnJ2OOJVb2eIM7EEcKeCNTHLUToks5uhM9OgaJpZM4Q9-Yt>
.
|
I refresh the token on each request right now as I test. I've been at this all day. I wonder what I am doing wrong The doc says: Is this the final syntax? with the
Or should it be without?
|
The correct syntax is remove the <> those are for placeholder purposes
…On Wed, Oct 3, 2018, 18:01 Dennis Orina ***@***.***> wrote:
I refresh the token on each request right now as I test. I've been at this
all day. I wonder what I am doing wrong
The doc says:
request["authorization"] = 'Bearer <Access-Token>'
Is this the final syntax? with the < and > for example:
request["authorization"] = 'Bearer <AhxAEU1p0L4AgxVHwiZ87k9R4QOY>
Or should it be without? < >
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#11 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AGMwCEXeaoowzCZ8FeIAxX5QjR86XRpiks5uhNFTgaJpZM4Q9-Yt>
.
|
Done that, Still same error. I'm writing this in ruby. Have a look at this
The Thank you for your help. |
i want to same issue facing like and also mpesa api approved(http://prntscr.com/mjvzhm) : |
I had to go to 'Edit' in my App then made sure the following was enabled: 1.Lipa Na Mpesa Sandbox 2.MPesa Sandbox And it worked! |
|
Thank you. I noticed if you make so many request using one app you
can't use for sometime.
…On 8/7/19, Nyundoo ***@***.***> wrote:
>
>
> I had to go to 'Edit' in my App then made sure the following was enabled:
>
> 1.Lipa Na Mpesa Sandbox
>
> 2.MPesa Sandbox
>
> And it worked!
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
#11 (comment)
--
*vnganga*
|
i still face the same error |
im using php...and im require to $_GET[''token'] first... { "requestId":"10018-959815-1", "errorCode": "401.003.01", "errorMessage": "Error Occurred - Invalid Access Token - Invalid access token" } my app is already approved |
@joshua20 With php something like: |
well for this issue as highlighted by @Nyundoogo 1.Lipa Na Mpesa Sandbox 2.MPesa Sandbox |
Had the same issue yet my lipa na mpesa app was approved on the portal. My workaround was to use a separate url to fetch the access token , then used it (the access token) to auth my page. Reason: i suspect the url is used as a factor when handling tokens since this is a security feature. therefor my url might be what is causing the access token to be rejected. I bet am wrong tho given that if url is used to dispense and check everything, why would one access token be used for multiple pages? All the best. |
@Gravity1 sounds interesting |
I facing this issue when simulating B2C payments |
Ensure the word 'MPesa' is not on your url i.e https://example.org/mpesa/register.php it should instead be something else i.e.
|
It turn out that I was using C2B shortcode for B2C operations |
joshua Pchumba is inviting you to a scheduled Zoom meeting.
Topic: [safaricom/LNMOnlineAndroidSample] Invalid Access Token (#11)
Join Zoom Meeting
https://us04web.zoom.us/j/77347364891?pwd=cDZLczNvMEN0bEFWUWVBWHRKYnFHUT09
Meeting ID: 773 4736 4891
Passcode: 934600
|
I solved this by confirming am using the right URL |
1-if you are facing the same problem as I was change the curl variable to ch daraja 2.0 changed that variable us $ch instead of $curl. if this helps add an emoji 😃 |
This works |
Awesome |
hi i had the same problem gave me sleepless nights for days here is how i solved it : Use a middleware function to generate the token then call it just before the stkPush route e.g app.post("/stkpush",generateToken,(req,res){} and here is my source code require("dotenv").config(); app.use(express.json()); const getAccessToken = async () => { try { const response = await axios.get(url, { headers }); // Middleware function to generate access token app.get("/stk", (req, res) => { app.post("/stk", generateToken, async (req, res) => { const date = new Date(); const shortCode = "174379"; // Sandbox: '174379' const stk_password = Buffer.from(shortCode + passkey + timestamp).toString( // Choose one depending on your development environment try { const requestBody = { const response = await axios.post(url, requestBody, { headers }); app.listen(PORT, () => { |
Hi Eric,am having a problem generating b2c access token can you please help |
check the mpesa shortcode or the express code |
Bonjour ! Aidez-moi a resoudre ce probleme { |
I am getting below response:
{
"requestId":"10219-2484793-1",
"errorCode": "404.001.03",
"errorMessage": "Invalid Access Token"
}
Kindly assist.
The text was updated successfully, but these errors were encountered: