Skip to content

Next

  • Projects
  • Groups
  • Snippets
  • Help
  • Sign in / Register
Minds Mobile
Minds Mobile
  • Project overview
  • Repository
  • Issues 240
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 12
  • Security & Compliance
  • Packages
  • Wiki
  • Snippets
  • Members
  • Collapse sidebar
  • Graph
  • Charts
  • Create a new issue
  • Commits
  • Issue Boards
  • Minds
  • Minds MobileMinds Mobile
  • Issues
  • #1453

Closed
Open
Opened 2 weeks ago by Narayanan KA@movingisliving2019
Report abuse New issue

Request Error on :api/v1/channel/me

Hello,

We have configured the Mobile native app for android. However we are getting this error while signing in to one of our accounts.

"Request Error on :api/v2/Oauth/token"

Getting the same error on Emulator as well as Physical device. Also the website is hosted on a separate server.

Here is the error logs from Website server

" 2019/10/22 10:44:40 [error] 6#6: *4834 FastCGI sent in stderr: "PHP message: Exception #1571741080: LogicException: Key path "file:///var/secure/oauth-priv.key" does not exist or is not readable in /var/www/ Minds/engine/vendor/league/oauth2-server/src/CryptKey.php:45 Stack trace: #0 /var/www/Minds/engine/vendor/league/oauth2-server/src/AuthorizationServer.php(104): League\OAuth2\Server\CryptKey->__construct('file:///var/sec...') #1 /var/www/Minds/engine/Core/OAuth/OAuthProvider.php(36): League\OAuth2\Server\AuthorizationServer->__construct(Object(Minds\Core\OAuth\Repositories\ClientRepository), Object(Minds\Core\OAuth\Repositories\A ccessTokenRepository), Object(Minds\Core\OAuth\Repositories\ScopeRepository), '/var/secure/oau...', '{{ jwt-secret }...') #2 (closed) [internal function]: Minds\Core\OAuth\OAuthProvider->Minds\Core\OAuth{closure}(Object(Minds\Core\Di\Di)) #3 (closed) /var/www/Minds/engine/Core/Di/Di.php(25): call_user_func(Object(Closure), Object(Minds\Core\Di\Di)) #4 (closed) /var/www/Minds/engine/Controllers/api/v2/oauth/token.php(30): Minds\Core\Di\Di->get('OAuth\Server\Au...')" while reading response header from upstream, client: 172.18.0.3, server: _, request: "POST /api /v2/oauth/token?cb=1571741078980 HTTP/1.1", upstream: "fastcgi://172.26.0.9:9000", host: "ABC.XYZ.in"

"

Edited 1 week ago by Narayanan KA

Related issues
0

  • Discussion 23
  • Designs 0
  • Narayanan KA @movingisliving2019 changed the description 2 weeks ago

    changed the description

  • Ben Hayward
    Ben Hayward @benhayward.ben · 2 weeks ago
    Developer

    CCing @msantang78 for you

  • Narayanan KA
    Narayanan KA @movingisliving2019 · 2 weeks ago

    @msantang78 Hello,

    Waiting to hear from your end.Kindly revert soon please.

  • Ben Hayward
    Ben Hayward @benhayward.ben · 2 weeks ago
    Developer

    You likely need to generate a private key and public key (named oauth-priv.key & oauth-pub.key) and place them in the directory it's expecting (secure - in the root directory)

  • Narayanan KA
    Narayanan KA @movingisliving2019 · 2 weeks ago

    @benhayward.ben Did that. Now we are getting a Request error on: "api/v1/channel/me" while logging in and signing up a new account.

  • Narayanan KA
    Narayanan KA @movingisliving2019 · 2 weeks ago

    @benhayward.ben Awaiting.

  • Narayanan KA
    Narayanan KA @movingisliving2019 · 2 weeks ago

    @msantang78 Awaiting.

  • Ben Hayward
    Ben Hayward @benhayward.ben · 2 weeks ago
    Developer

    Have you made sure you are using an up to date version of the app?

  • Narayanan KA
    Narayanan KA @movingisliving2019 · 2 weeks ago

    Hey ben,Yes....the latest version.Sent from my Samsung Galaxy smartphone.

  • Narayanan KA
    Narayanan KA @movingisliving2019 · 2 weeks ago

    @benhayward.ben awaiting your response.

  • Ben Hayward
    Ben Hayward @benhayward.ben · 2 weeks ago
    Developer

    I'm unable to be of any further help on this unfortunately, the mobile app is not my domain. Will have to pass to @msantang78.

    First thing I'd suggest is including the error.

  • Narayanan KA
    Narayanan KA @movingisliving2019 · 2 weeks ago

    Hi @msantang78, I am getting the following error when trying to login or signup from the app (localhost) : Request error on: "api/v1/channel/me". The minds website is setup on google cloud(development mode), and the corresponding domain name has been replaced in the app. As for the detailed error log, do i get one from website nginx/php-fpm or android studio ?

  • Narayanan KA
    Narayanan KA @movingisliving2019 · 1 week ago

    Hi @msantang78 Awaiting.

  • Narayanan KA
    Narayanan KA @movingisliving2019 · 1 week ago

    @benhayward.ben Could you kindly request @msantang78 to communicate please. We are waiting since quite some time.

  • Narayanan KA @movingisliving2019 changed title from Request Error on :api/v2/Oauth/token to Request Error on :api/v1/channel/me 1 week ago

    changed title from Request Error on :api/v to Request Error on :api/v

  • Martin Santangelo
    Martin Santangelo @msantang78 · 1 week ago
    Maintainer

    @movingisliving2019 did you fix the backend error? ("file:///var/secure/oauth-priv.key" does not exist or is not readable)

  • Narayanan KA
    Narayanan KA @movingisliving2019 · 1 week ago

    @msantang78 yeah fixed the backend error.

  • Narayanan KA
    Narayanan KA @movingisliving2019 · 1 week ago

    @msantang78. what can we do now ?

  • Martin Santangelo
    Martin Santangelo @msantang78 · 1 week ago
    Maintainer

    I had once a problem with that endpoint because of the cookies. The mobile app uses token-based auth, so it should not send the cookies. That is why I added this workaround to clean the cookies sent by the server https://gitlab.com/minds/mobile-native/blob/master/src/auth/AuthService.js#L23 Please check if for some reason you are sending the session cookies to the backend.

  • Narayanan KA
    Narayanan KA @movingisliving2019 · 1 week ago

    @msantang78 I checked and AuthService.js seems to have the line you mentioned. As for checking if session cookies are being sent to backend, any ideas on where or how to check.

  • Narayanan KA
    Narayanan KA @movingisliving2019 · 1 week ago

    @msantang78 waiting furthur steps

  • Narayanan KA
    Narayanan KA @movingisliving2019 · 4 days ago

    @msantang78 , I just tried to do the following request in postman, which should be what's happening in the minds-mobile GET http://{{host}}/api/v1/channel/me and set the authorization to Bearer and pasted the access_token from /api/v2/oauth/token. I am getting the following error:

    { "error": "Sorry, you are not authenticated", "code": 401, "loggedin": false }

    This (probably) explains why I am getting the error in android. Now in postman, I could solve this by using api/v1/authenticate and the cookies therein. But as far as I could see, minds-mobile uses token everywhere, which doesn't seem to work for some reason in my installation. I even added the CookieManager.clearAll() line to every async function in the file AuthService.js to no effect.

    (PS: The issue in postman could be due to the temporary headers postman auto-generates. But Insomnia gives me the same result)

    Edited by Narayanan KA 4 days ago
  • Narayanan KA
    Narayanan KA @movingisliving2019 · 3 days ago

    @msantang78 awaiting

  • Narayanan KA
    Narayanan KA @movingisliving2019 · 18 hours ago

    @msantang78 please respond

  • Narayanan KA
    Narayanan KA @movingisliving2019 · 3 hours ago

    @msantang78 , @benhayward.ben , I was looking into the settings.php file, and this the settings for oauth:

    $CONFIG->set('oauth', [ 'clients' => [ 'mobile' => [ 'secret' => '', ], ], 'encryption_key' => '{{ jwt-secret }}', ]);

    Could this have something to do with the problem I am facing ?

Please register or sign in to reply
0 Assignees
None
none
Epic
None
None
Milestone
None
Time tracking
No estimate or time spent
None
Due date
None
0
Labels
None
None
Weight
None
Confidentiality
Not confidential
Lock issue
Unlocked
3
3 participants
user avatar
Narayanan KA
user avatar
Martin Santangelo
user avatar
Ben Hayward
Reference: minds/mobile-native#1453