[bd] API

[bd] API 1.6.3

No permission to download
Hello,

is it possible to return all users of a specified user group through the API? Have skimmed through the documentation, but haven't found anything unless I don't want to iterate all users :/

Unfortunately I cannot ask in their board because I've apparently lost permissions to post there?
Code:
You have insufficient privileges to post here.
 
I'm having trouble authenticating rocketchat through this. Maybe someone can help.

Here is rocket.chat's oauth configuration. I think I have some values messed up.

upload_2017-6-24_12-35-16.webp
 
Could you update the bundled copy of oauth2-server-php? 1.7.0 is two years old, and I just ran into a problem caused by deprecation of mcrypt_create_iv in PHP 7.1 (fixed in https://github.com/bshaffer/oauth2-server-php/pull/773).

It would also be a good idea to move away from mcrypt altogether at some point.

That pull request was actually made by us. New release should be available soon and include that fix.

Will be released shortly? Getting mcrypt_create_iv deprecation errors all the time ....
Code:
Server Error Log

Error Info
ErrorException: Function mcrypt_create_iv() is deprecated - library/bdApi/Lib/oauth2-server-php/src/OAuth2/ResponseType/AccessToken.php:118
Generated By: Unknown Account, 4 minutes ago
 
@xfrocks Hey man, great work.

I wanted to ask a few quick questions, as I'm new to working with oAuth2.

So, I want to use my Xenforo installation to login to another web application. The way I envision this would be a login page button that says 'login with Xenforo' etc.

The issue here is, I don't want users to have to create clients themselves. I want them to just be directed to the auth URI, they login, then redirected back to the Web App with their token in the headers. This way, I don't have to get users to know what a 'redirect URI' is.

Any tips?

Thanks!
 
@xfrocks Hey man, great work.

I wanted to ask a few quick questions, as I'm new to working with oAuth2.

So, I want to use my Xenforo installation to login to another web application. The way I envision this would be a login page button that says 'login with Xenforo' etc.

The issue here is, I don't want users to have to create clients themselves. I want them to just be directed to the auth URI, they login, then redirected back to the Web App with their token in the headers. This way, I don't have to get users to know what a 'redirect URI' is.

Any tips?

Thanks!
You only need to create client once. All login will then proceed with that one client, users don't need to create their own FYI.
 
You only need to create client once. All login will then proceed with that one client, users don't need to create their own FYI.

Ah yes, I figured it out in the end!

I definitely need to wrap my head around OAuth more. Thanks for the quick response!

Great addon
 
@xfrocks hi.
when i trying android app with bdapi i m getting those errors and cant post any messages at web browser.

Zend_Db_Statement_Mysqli_Exception: Mysqli prepare error: Unknown column 'bdapi_origin' in 'field list' - library/Zend/Db/Statement/Mysqli.php:77
Oluşturan: XXXXXXX 11 dakika önce

#0 /home/sadecega/public_html/library/Zend/Db/Statement.php(115): Zend_Db_Statement_Mysqli->_prepare('INSERT INTO `xf...')
#1 /home/sadecega/public_html/library/Zend/Db/Adapter/Mysqli.php(381): Zend_Db_Statement->__construct(Object(Zend_Db_Adapter_Mysqli), 'INSERT INTO `xf...')
#2 /home/sadecega/public_html/library/Zend/Db/Adapter/Abstract.php(478): Zend_Db_Adapter_Mysqli->prepare('INSERT INTO `xf...')
#3 /home/sadecega/public_html/library/Zend/Db/Adapter/Abstract.php(574): Zend_Db_Adapter_Abstract->query('INSERT INTO `xf...', Array)
#4 /home/sadecega/public_html/library/XenForo/DataWriter.php(1638): Zend_Db_Adapter_Abstract->insert('xf_post', Array)
#5 /home/sadecega/public_html/library/XenForo/DataWriter.php(1627): XenForo_DataWriter->_insert()
#6 /home/sadecega/public_html/library/XenForo/DataWriter.php(1419): XenForo_DataWriter->_save()
#7 /home/sadecega/public_html/library/XenForo/ControllerPublic/Thread.php(578): XenForo_DataWriter->save()
#8 /home/sadecega/public_html/library/XenForo/FrontController.php(351): XenForo_ControllerPublic_Thread->actionAddReply()
#9 /home/sadecega/public_html/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#10 /home/sadecega/public_html/index.php(13): XenForo_FrontController->run()
#11 {main}
 

Attachments

  • 6798175B-6033-44A8-AE88-A1D2F2326CC2.webp
    6798175B-6033-44A8-AE88-A1D2F2326CC2.webp
    81.4 KB · Views: 5
@xfrocks hi.
when i trying android app with bdapi i m getting those errors and cant post any messages at web browser.

Zend_Db_Statement_Mysqli_Exception: Mysqli prepare error: Unknown column 'bdapi_origin' in 'field list' - library/Zend/Db/Statement/Mysqli.php:77
Oluşturan: XXXXXXX 11 dakika önce

#0 /home/sadecega/public_html/library/Zend/Db/Statement.php(115): Zend_Db_Statement_Mysqli->_prepare('INSERT INTO `xf...')
#1 /home/sadecega/public_html/library/Zend/Db/Adapter/Mysqli.php(381): Zend_Db_Statement->__construct(Object(Zend_Db_Adapter_Mysqli), 'INSERT INTO `xf...')
#2 /home/sadecega/public_html/library/Zend/Db/Adapter/Abstract.php(478): Zend_Db_Adapter_Mysqli->prepare('INSERT INTO `xf...')
#3 /home/sadecega/public_html/library/Zend/Db/Adapter/Abstract.php(574): Zend_Db_Adapter_Abstract->query('INSERT INTO `xf...', Array)
#4 /home/sadecega/public_html/library/XenForo/DataWriter.php(1638): Zend_Db_Adapter_Abstract->insert('xf_post', Array)
#5 /home/sadecega/public_html/library/XenForo/DataWriter.php(1627): XenForo_DataWriter->_insert()
#6 /home/sadecega/public_html/library/XenForo/DataWriter.php(1419): XenForo_DataWriter->_save()
#7 /home/sadecega/public_html/library/XenForo/ControllerPublic/Thread.php(578): XenForo_DataWriter->save()
#8 /home/sadecega/public_html/library/XenForo/FrontController.php(351): XenForo_ControllerPublic_Thread->actionAddReply()
#9 /home/sadecega/public_html/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#10 /home/sadecega/public_html/index.php(13): XenForo_FrontController->run()
#11 {main}
Have you installed the add-on? Try updating it with the XML to trigger the install code again.
 
@xfrocks any tips for handling the TFA response?

I've had a look through your PHP demo on github, but I couldn't find where you handle the TFA.

Currently, my app get's through the GET just fine:

Request:
JSON:
array(7) {
  ["_origRoutePath"] => string(15) "oauth/authorize"
  ["_matchedRoutePath"] => string(15) "oauth/authorize"
  ["client_id"] => string(10) "XXXXXX"
  ["redirect_uri"] => string(34) "my/callback"
  ["scope"] => string(34) "read,post,usercp,conversate,adm…"
  ["response_type"] => string(4) "code"
  ["state"] => string(34) "Ydwx1soU94H7D4bE9WvgHneX6u9ekKj…"
}

Response:
JSON:
array(2) {
  ["redirectType"] => int(5)
  ["redirectUri"] => string(34) "https://dev.7cav.us/account/aut…"
}


---- Then ----

Request:
JSON:
array(6) {
  ["_origRoutePath"] => string(11) "oauth/token"
  ["_matchedRoutePath"] => string(11) "oauth/token"
  ["client_id"] => string(10) "XXXX"
  ["client_secret"] => string(15) "XXXXXXXXX"
  ["redirect_uri"] => string(34) "my/callback"
  ["grant_type"] => string(18) "authorization_code"
}

Response:
JSON:
array(4) {
  ["error"] => string(15) "invalid_request"
  ["error_description"] => string(34) "Missing parameter: "code" is re…"
  ["_statusCode"] => int(400)
  ["_headers"] => array(1) {
    ["Cache-Control"] => string(8) "no-store"
  }
}

Any advice?

Thanks!
 
You can use this to setup push notification but this add-on by itself does not do that by itself FYI.

Can you elaborate on that? I'm a little uncertain on what is included in the API, in your Android demo you send the GCM token to a web-service. Does that mean the part with registering a user is implemented?

I'm also getting an error when trying to call any of the endpoints:
An exception occurred: Undefined index: scheme in /customers/1/b/c/mysite/httpd.www/library/bdApi/Link.php on line 138
 
Can you elaborate on that? I'm a little uncertain on what is included in the API, in your Android demo you send the GCM token to a web-service. Does that mean the part with registering a user is implemented?

I'm also getting an error when trying to call any of the endpoints:
An exception occurred: Undefined index: scheme in /customers/1/b/c/mysite/httpd.www/library/bdApi/Link.php on line 138
Yes, you need something like this https://github.com/xfrocks/node_pubhubsubbub_pushserver
 
Hey @xfrocks!

I'm working on a composer package, seeing as my app is in laravel and I thought I might as well leave this out for others to use.

A few quick questions:

- Firstly, are you cool with me packaging my wrapper on packagist and leaving it open source for others to use in their own laravel apps?

- I scanned back through this thread and saw you mention about making an 'admin token' for an admin account that can access all of a given forums data. Is there a way I can keep this token going indeffinitely, or will I have to Auth it each time I want to make a request? I saw the 'Time to live' option in the backend, but this is a limit that could one day expire.

- Are you happy for me to send PR's of your documentation on Github? I feel that it could be cleaned up slightly as I go along wrapping it up.

Thanks again.
 
Top Bottom