Calling Graphi API from Classic JavaScript through msal.js

I am trying to do silent login through msal.js and then trying to call graph api but always I get 403 error. When I decrypt my access token through jwt.ms I can see that audience is correct but scopes are showing wrong. Hope some can help me.

My code

let config = {     auth: {       clientId: _spPageContextInfo.spfx3rdPartyServicePrincipalId,       authority: `https://login.microsoftonline.com/$  {_spPageContextInfo.aadTenantId}`,       redirectUri: 'https://xxx.sharepoint.com/sites/xxx-Dev/Pages/myportal.aspx',       validateAuthority: false,       postLogoutRedirectUri: window.origin,     },     cache: {       cacheLocation: 'localStorage',       storeAuthStateInCookie: true     }   }    let myMSALObj = new Msal.UserAgentApplication(config)   let graphConfig = {     graphGroupEndpoint: "https://graph.microsoft.com/v1.0/groups"   }    let request = {     scopes: ["https://graph.microsoft.com/.default"]   }     myMSALObj.handleRedirectCallback(response => { console.log(response) });   //const idTokenScope = { scopes: [_spPageContextInfo.spfx3rdPartyServicePrincipalId] }    const handleError = (error) => {     if (error.errorCode === 'consent_required'       || error.errorCode === 'interaction_required'       || error.errorCode === 'login_required') {       //myMSALObj.loginRedirect(idTokenScope);       myMSALObj.loginRedirect(request);       return;     }     throw error;   };    const getToken = () => {     const date = new Date();     const user = myMSALObj.getAccount();     if (!user) {       //myMSALObj.loginRedirect(idTokenScope);       myMSALObj.loginRedirect(request);       return;     }     //myMSALObj.acquireTokenSilent(idTokenScope).then(response => {     myMSALObj.acquireTokenSilent(request).then(response => {       console.log(`$  {date.toLocaleTimeString()}`, response.accessToken);       callMSGraph(graphConfig.graphGroupEndpoint, response.accessToken, graphAPICallback)     }).catch(handleError);   }   getToken()    function callMSGraph(theUrl, accessToken, callback) {     var xmlHttp = new XMLHttpRequest()     xmlHttp.onreadystatechange = function () {       if (this.readyState == 4 && this.status == 200)         callback(JSON.parse(this.responseText))     }     xmlHttp.open("GET", theUrl, true)     xmlHttp.setRequestHeader('Authorization', 'Bearer ' + accessToken)     xmlHttp.send()   }   function graphAPICallback(data) {     document.write(JSON.stringify(data, null, 2))   } 

My decoded token enter image description here

My app permission enter image description here

[ Politics ] Open Question : Do you give Bill Maher credit? I will give Bill Maher credit on this, he is calling it out regardless of his bias.?

Maher has always been a huge liberal but I will give him credit on this, he is calling it out regardless of his bias. One of the few people in media that didnt let his bias get in the way of the facts. “Real Time” host Bill Maher slammed Hunter Biden’s business ties to Ukraine, suggesting MSNBC’s Rachel Maddow would be talking about it if it were one of President Trump’s children. “The more I read about this- no, I don’t think he was doing something terrible in Ukraine, but it’s just- why can’t politicians tell their f—–‘ kids, ‘Get a job, get a godd–n job!”” Maher told the panel. “This kid was paid $ 600,000 because his name is Biden by a gas company in Ukraine, this super-corrupt country that just had a revolution to get rid of corruption. It just looks bad.’ “And if Don Jr. did it, it would be all Rachel Maddow was talking about’

ret2libc calling function arguments order

while I was studying the ret2libc a doubt as arisen. I saw that peoples in their tutorials use the following: call_to_function + ret addr+ arguments. For example I understand that if I want to execute system function from libc I can use the following scheme: system_address(that overwrite eip) + addrsssOf_exit_function + arguments. What I didn’t understand instead is why we use this order if before calling a function the arguments need to be already on the stack?. If I overwrite the eip the next instruction called is system but we don’t have already the arguments, right? What’s I’m missing?

Error al instalar en emulador aplicacion “Calling main entry com.android.commands.wm.Wm”

Estoy usando un ejemplo de internet para crear un sistema de login con PHP + Mysql, cuando trato de ejecutar la aplicación no hace nada y me devuelve esto en el logcat

2019-09-13 11:31:03.749 5897-5897/? D/AndroidRuntime: >>>>>> START com.android.internal.os.RuntimeInit uid 2000 <<<<<< 2019-09-13 11:31:03.751 5897-5897/? D/AndroidRuntime: CheckJNI is ON 2019-09-13 11:31:03.769 5897-5897/? W/art: Unexpected CPU variant for X86 using defaults: x86 2019-09-13 11:31:03.772 5897-5897/? D/ICU: No timezone override file found: /data/misc/zoneinfo/current/icu/icu_tzdata.dat 2019-09-13 11:31:03.787 5897-5897/? E/memtrack: Couldn’t load memtrack module (No such file or directory) 2019-09-13 11:31:03.787 5897-5897/? E/android.os.Debug: failed to load memtrack module: -2 2019-09-13 11:31:03.787 5897-5897/? I/Radio-JNI: register_android_hardware_Radio DONE 2019-09-13 11:31:03.794 5897-5897/? D/AndroidRuntime: Calling main entry com.android.commands.wm.Wm 2019-09-13 11:31:03.799 5897-5897/? D/AndroidRuntime: Shutting down VM

el codigo de la activiy de inicio es este

package com.paquete;  import android.app.ProgressDialog; import android.os.Bundle; import android.widget.Button; import android.widget.EditText;  import androidx.appcompat.app.AppCompatActivity;  import com.paquete.Utilidades.SessionHandler;  public class LoginActivity extends AppCompatActivity {      private static final String KEY_STATUS = "status";     private static final String KEY_MESSAGE = "message";     private static final String KEY_FULL_NAME = "full_name";     private static final String KEY_USERNAME = "username";     private static final String KEY_PASSWORD = "password";     private static final String KEY_EMPTY = "";     private EditText etUsername;     private EditText etPassword;     private Button register, login;     private String username;     private String password;     private ProgressDialog pDialog;     private String login_url = "http://urllogin/login/login";     private SessionHandler session;      @Override     protected void onCreate(Bundle savedInstanceState) {         super.onCreate( savedInstanceState );          session = new SessionHandler(getApplicationContext());        if(session.isLoggedIn()){             loadDashboard();         }          setContentView( R.layout.activity_login );          etUsername = findViewById(R.id.etLoginUsername);         etPassword = findViewById(R.id.etLoginPassword);          register = findViewById(R.id.btnLoginRegister);         login = findViewById(R.id.btnLogin);     //Launch Registration screen when Register Button is clicked         register.setOnClickListener(new View.OnClickListener() {             @Override             public void onClick(View v) {                 Intent i = new Intent(LoginActivity.this, RegisterActivity.class);                 startActivity(i);                 finish();             }         });          login.setOnClickListener(new View.OnClickListener() {             @Override             public void onClick(View v) {                 //Retrieve the data entered in the edit texts                 username = etUsername.getText().toString().toLowerCase().trim();                 password = etPassword.getText().toString().trim();                 if (validateInputs()) {                     login();                 }             }         });      }      private void loadDashboard() {         Intent i = new Intent(getApplicationContext(), DashboardActivity.class);         startActivity(i);         finish();      }      private void displayLoader() {         pDialog = new ProgressDialog(LoginActivity.this);         pDialog.setMessage("Logging In.. Please wait...");         pDialog.setIndeterminate(false);         pDialog.setCancelable(false);         pDialog.show();      }      private void login() {         displayLoader();         JSONObject request = new JSONObject();         try {             //Populate the request parameters             request.put(KEY_USERNAME, username);             request.put(KEY_PASSWORD, password);          } catch (JSONException e) {             e.printStackTrace();         }         JsonObjectRequest jsArrayRequest = new JsonObjectRequest                 ( Request.Method.POST, login_url, request, new Response.Listener<JSONObject>() {                     @Override                     public void onResponse(JSONObject response) {                         pDialog.dismiss();                         try {                             //Check if user got logged in successfully                              if (response.getInt(KEY_STATUS) == 0) {                                 session.loginUser(username,response.getString(KEY_FULL_NAME));                                 loadDashboard();                              }else{                                 Toast.makeText(getApplicationContext(),                                         response.getString(KEY_MESSAGE), Toast.LENGTH_SHORT).show();                              }                         } catch (JSONException e) {                             e.printStackTrace();                         }                     }                 }, new Response.ErrorListener() {                      @Override                     public void onErrorResponse(VolleyError error) {                         pDialog.dismiss();                          //Display error message whenever an error occurs                         Toast.makeText(getApplicationContext(),                                 error.getMessage(), Toast.LENGTH_SHORT).show();                      }                 });          // Access the RequestQueue through your singleton class.         MySingleton.getInstance(this).addToRequestQueue(jsArrayRequest);     }      private boolean validateInputs() {         if(KEY_EMPTY.equals(username)){             etUsername.setError("Username cannot be empty");             etUsername.requestFocus();             return false;         }         if(KEY_EMPTY.equals(password)){             etPassword.setError("Password cannot be empty");             etPassword.requestFocus();             return false;         }         return true;     }    } 

El archivo manifest.xml quedo asi

<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android"     package="com.qbacode.papelografo">      <uses-permission android:name="android.permission.INTERNET"/>       <application         android:allowBackup="true"         android:icon="@mipmap/ic_launcher"         android:label="@string/app_name"         android:roundIcon="@mipmap/ic_launcher_round"         android:supportsRtl="true"         android:theme="@style/AppTheme">         <activity android:name=".DashboardActivity"></activity>         <activity android:name=".RegisterActivity"             android:configChanges="orientation|keyboardHidden|screenSize" />         <activity android:name=".LoginActivity"             android:configChanges="orientation|keyboardHidden|screenSize">             <intent-filter>                 <action android:name="android.intent.action.MAIN" />                  <category android:name="android.intent.category.LAUNCHER" />             </intent-filter>         </activity>     </application>    </manifest> 

Exception calling “ExecuteQuery” with “0” argument(s): “The operation has timed out.”

I am trying to delete list items, about 130K, from a large list on SharePoint Online using powershell CSOM, i am getting this error

“Exception calling “ExecuteQuery” with “0” argument(s): “The operation has timed out.””

this is my code

    for ($  i=$  allItems.Count-1; $  i-ge0; $  i--)       {           $  allItems[$  i].DeleteObject()         #$  clientContext.ExecuteQuery()        }        $  clientContext.ExecuteQuery()  

When i use the ExecuteQuery() outside the loop, i am getting this error. but it still deletes around 1K items each time i run the script.

But When i use the ExecuteQuery() inside the loop, it doesn’t throw the error and the script completes execution, BUT it takes about 20 times the time taken to delete items when ExecuteQuery() used outside the loop

i also used RequestTimeout property

$ clientContext.RequestTimeout = [System.Threading.Timeout]::Infinite ( or any value)

it doesn’t seem to honor this property.

Could anyone please help me suggest a better way to delete such a large list ( the list is still being used, i can’t delete the list)?

Thanks so much Maria Francis

Magento 1.14 – admin _prepareCollection() and _prepareColumns() are not rendering or not calling

In Magento 1.14 – admin _prepareCollection() and _prepareColumns() are not rendering or not calling. Could anyone please help me out why these functions are not loading from grid.php. Below is my config.xml

<global> <models>         <tk_autoShip>             <class>Tk_AutoShip_Model</class>             <resourceModel>tk_autoShip_resource</resourceModel>         </tk_autoShip>          <!-- Resource model to create a database table -->         <tk_autoShip_resource>             <class>Tk_AutoShip_Model_Resource</class>             <entities>                 <autoshipgrid>                     <table>tk_autoship_tkautoship</table>                 </autoshipgrid>                                 </entities>         </tk_autoShip_resource>     </models>  <resources>      <tk_autoShip_setup>           <setup>               <module>Tk_AutoShip</module>           </setup>      <connection>         <use>core_setup</use>      </connection>      </tk_autoShip_setup>  </resources> <blocks>   <tk_autoShip>     <class>Tk_AutoShip_Block</class>   </tk_autoShip> </blocks> <helpers>     <tk_autoShip>         <class>Tk_AutoShip_Helper</class>     </tk_autoShip> </helpers> 

Tk_AutoShip_Adminhtml admin Tk_AutoShip tk_autoShip autoshipgrid.xml

calling external API in sharepoint framework

I am trying to call dummy API from SPFX, but getting error that Failed to fetch,

  this.context.httpClient   .get("http://dummy.restapiexample.com/api/v1/employees", HttpClient.configurations.v1)   .then((res: HttpClientResponse): Promise<any> => {     alert("");     return res.json();   })   .then((data: any): void => {     alert("");     // process your data here   }, (err: any): void => {     // handle error here   }); 

Please suggest here..

SharePoint Online w/ 2013 workflow calling 2010 workflow

Currently we have a collection with six sub-sites, each site has a document library to store operational functions relating to the facility. To help standardize the approval and notification of these documents I generated a reusable 2010 workflow that was published globally.

The initial problem is that on the collection level a contact list was created, with information that pertains to each facility.

  • Site Lookup : Cannot publish globally, causes same workflow on multiple sites.

To rectify my primary problem I introduced a 2013 workflow, which would perform a web request to obtain the information rather than have a site lookup. But this introduced the following:

  • 2013 workflow does not have associative columns, forcing me to “Start 2010 workflow” with initiation columns.
  • Cannot deploy 2013 workflow globally like 2010 workflow.

Which introduces an issue on a sub-site where the 2013 workflow is trying to add parameters to a global 2010 workflow, it will not do. If I create a copy of the global workflow and use that on the list the parameter box appears without an issue.

Only solutions I can think of would be a 2013 workflow that populates a list on each site, then pause the 2010 workflow to use that value. Create multiple contact list, requiring multiple maintenance locations.

Is there a better way? Or am I going to be forced to duplicate workflows to some degree?

Method Code Coverage not covering incase of calling flatMap() in Spring Reactor

First take a look inside the code

   WebClient client = WebClient.create("TEMP URL);          Mono<Employee> employeeMono = client.get()                 .uri("temp url")                 .accept(MediaType.APPLICATION_JSON)                 .retrieve()                 .bodyToMono(Employee.class);          return employeeMono.flatMap(this::employeeMapper);      public EmployeeDTO employeeMapper(Employee employee){     //     //     //     //     } 

I’m calling Code coverage in IntellijIDEA, all lines are covered but employeeMapper() unable in case of if I using Mono with FlatMap method.

I need to covered the employeeMapper(), please suggest me what should I need to do so that code inside the employeeMapper() also covered.

Please let me know in case you need more clarification.

Thanks in advance Yasir