# Can non-admin user issue their own API key?

**URL:** https://meta.discourse.org/t/can-non-admin-user-issue-their-own-api-key/173226
**Category:** Development
**Tags:** rest-api
**Created:** [December 14, 2020, 9:31am UTC](https://meta.discourse.org/t/can-non-admin-user-issue-their-own-api-key/173226 "2020-12-14T09:31:28Z")
**Posts on this page:** 1
**Showing post:** 8

<div class="post-metadata">

### Author: ![KengoTODA](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kengotoda/32/203231_2.png) [@KengoTODA](https://meta.discourse.org/u/KengoTODA)
#### Post date: [December 15, 2020, 1:12am UTC](https://meta.discourse.org/t/can-non-admin-user-issue-their-own-api-key/173226/8 "2020-12-15T01:12:36Z")

</div>

I’m working in [this branch](https://github.com/KengoTODA/sonar-update-center-action/tree/54212084e9ec8ab2c364ec5e96bf1fac7301a557), and successfully run the command using `localhost` as redirect URL. However, after I click the button to authorize, the page [https://meta.discourse.org/user-api-key](https://meta.discourse.org/user-api-key) reported a JS error and it could not proceed the operation. The [ruby script](https://meta.discourse.org/t/generating-user-api-keys-for-testing/145744) works but it also fails when I add `auth_redirect` parameter.

Here is the exception reported in the browser console:

```plaintext
Uncaught TypeError: Cannot set property 'isReadOnly' of undefined
    at Function.createCurrent (_application-42d4413fabab7a4b12e0c25fb01f736af560aa283089071a8493f37c9b042a4a.js:44867)
    at Function.current (_application-42d4413fabab7a4b12e0c25fb01f736af560aa283089071a8493f37c9b042a4a.js:8816)
    at Object.initialize (_application-42d4413fabab7a4b12e0c25fb01f736af560aa283089071a8493f37c9b042a4a.js:70403)
    at Object.i.initialize (_application-42d4413fabab7a4b12e0c25fb01f736af560aa283089071a8493f37c9b042a4a.js:7001)
    at _ember_jquery-189e46ebcb33594b835e782fd1ce916ec750bc0cf980ebc4fb7796649161a18d.js:49660
    at i.each (_ember_jquery-189e46ebcb33594b835e782fd1ce916ec750bc0cf980ebc4fb7796649161a18d.js:67904)
    at i.walk (_ember_jquery-189e46ebcb33594b835e782fd1ce916ec750bc0cf980ebc4fb7796649161a18d.js:67891)
    at n.each (_ember_jquery-189e46ebcb33594b835e782fd1ce916ec750bc0cf980ebc4fb7796649161a18d.js:67858)
    at n.topsort (_ember_jquery-189e46ebcb33594b835e782fd1ce916ec750bc0cf980ebc4fb7796649161a18d.js:67758)
    at t._runInitializer (_ember_jquery-189e46ebcb33594b835e782fd1ce916ec750bc0cf980ebc4fb7796649161a18d.js:49667)

```

I will attach the screenshot from JS code analysis. it seems that the `siteAttribtues` is expected to be proper value, but it’s `undefined`. If you have any suggestion to me, please let me know. Thank you!

 ![スクリーンショット 2020-12-15 085706](https://global.discourse-cdn.com/meta/original/3X/d/0/d0d260abe0e7ccc86914eb764226478712f7d793.png)

---

_[View the full topic](https://meta.discourse.org/t/can-non-admin-user-issue-their-own-api-key/173226)._
